One of the following two values must be included in flag:RTLD_LAZY or RTLD_NOW
Zero of more of the following values may also be ORed in flag:RTLD_GLOBAL, RTLD_LOCAL, RTLD_NODELETE, RTLD_NOLOAD, RTLD_DEEPBIND
My understanding (which may be incorrect), with linux, if one of RDLD_LAZY or RTLD_NOW is not included in the flags, the dlopen() call fails and returns with NULL.