DragonFly On-Line Manual Pages

Search: Section:  

DLCLOSE(3)            DragonFly Library Functions Manual            DLCLOSE(3)


dlclose -- unlink shared object from process address space


This function is not in a library. It is included in every dynamically linked program automatically.


#include <dlfcn.h> int dlclose(void *handle);


The dlclose() function deletes a reference to the shared object referenced by handle. If the reference count drops to 0, the object is removed from the address space, and handle is rendered invalid. Just before removing a shared object in this way, the dynamic linker calls the object's _fini() function, if such a function is defined by the object. The object-intrinsic functions _init() and _fini() are called with no arguments, and are not expected to return values.


The dlclose() function returns 0 on success, or -1 if an error occurred. Whenever an error has been detected, a message detailing it can be retrieved via a call to dlerror().


rtld(1), dlerror(3), dlfcn(3), dlopen(3) DragonFly 5.5 April 29, 2011 DragonFly 5.5

Search: Section: