#include <dlfcn.h>
dlfcn.h
Based on the dlcompat work done by:
Jorge Acereda <jacereda@users.sourceforge.net> &
Peter O'Gorman <ogorman@users.sourceforge.net>
structdl_info
Structure filled in by dladdr().
| const char * | dli_fname | Pathname of shared object |
| void * | dli_fbase | Base address of shared object |
| const char * | dli_sname | Name of nearest symbol |
| void * | dli_saddr | Address of nearest symbol |
functiondladdr
extern int dladdr(const void *, Dl_info *)
man page · September 24, 2004
dladdr(3) — find the image containing a given addressfunctiondlclose
__DYLDDL_UNAVAILABLE
extern int dlclose(void * __handle)man page · Feb 8, 2024
dlclose(3) — close a dynamic library or bundlefunctiondlerror
__DYLDDL_UNAVAILABLE
extern char * dlerror(void)man page · April 17, 2006
dlerror(3) — get diagnostic informationfunctiondlopen
__DYLDDL_UNAVAILABLE
extern void * dlopen(const char * __path, int __mode)man page · Feb 8, 2024
dlopen(3) — load and link a dynamic library or bundlefunctiondlsym
__DYLDDL_DLSYM_UNAVAILABLE
extern void * dlsym(void * __handle, const char * __symbol)man page · August 28, 2008
dlsym(3) — get address of a symbolfunctiondlopen_preflight
__API_AVAILABLE(macos(10.5), ios(2.0)) __DYLDDL_UNAVAILABLE
extern bool dlopen_preflight(const char* __path)man page · May 11, 2020
dlopen_preflight(3) — preflight the load of a dynamic library or bundlemacroRTLD_LAZY
#define RTLD_LAZY 0x1
macroRTLD_NOW
#define RTLD_NOW 0x2
macroRTLD_LOCAL
#define RTLD_LOCAL 0x4
macroRTLD_GLOBAL
#define RTLD_GLOBAL 0x8
macroRTLD_NOLOAD
#define RTLD_NOLOAD 0x10
macroRTLD_NODELETE
#define RTLD_NODELETE 0x80
macroRTLD_NEXT
Special handle arguments for dlsym().
#define RTLD_NEXT ((void *) -1)
Search subsequent objects.
macroRTLD_SELF
#define RTLD_SELF ((void *) -3)
Search this and subsequent objects (Mac OS X 10.5 and later)
macroRTLD_MAIN_ONLY
#define RTLD_MAIN_ONLY ((void *) -5)
Search main executable only (Mac OS X 10.5 and later)