Query: dlclose
OS: osx
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
DLCLOSE(3) BSD Library Functions Manual DLCLOSE(3)NAMEdlclose -- close a dynamic library or bundleSYNOPSIS#include <dlfcn.h> int dlclose(void* handle);DESCRIPTIONdlclose() releases a reference to the dynamic library or bundle referenced by handle. If the reference count drops to 0, the bundle is removed from the address space, and handle is rendered invalid. Just before removing a dynamic library or bundle in this way, any termina- tion routines in it are called. handle is the value returned by a previous call to dlopen. Prior to Mac OS X 10.5, only bundles could be unloaded. Starting in Mac OS X 10.5, dynamic libraries may also be unloaded. There are a cou- ple of cases in which a dynamic library will never be unloaded: 1) the main executable links against it, 2) An API that does not supoort unloading (e.g. NSAddImage()) was used to load it or some other dynnamic library that depends on it, 3) the dynamic library is in dyld's shared cache.RETURN VALUESIf dlclose() is successful, it returns a value of 0. Otherwise it returns -1, and sets an error string that can be retrived with dlerror().SEE ALSOdlopen(3) dlsym(3) dlerror(3) dyld(3) ld(1) cc(1) Nov 6, 2006