NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO | NOTES
#include <cx/dlfcn.h>int dlclose(void *handle);
ACTOR_EXTENDED_MNGT, DYNAMIC_LIB
dlclose() is a member of the dynamic linking API, a family of routines that give the user direct access to dynamic linking functionality.
dlclose() is only available to programs and libraries compiled with imake rules of the form DynamicTypeTarget(), where Type is one of User, Sup, CXXUser, CXXSup or Library.
See the ChorusOS 4.0 Introduction for more information on building executables with dynamic libraries.
dlclose() dissociates a dynamic object previously opened by dlopen() from the current actor. Once an object has been closed using dlclose(), its symbols are no longer available to dlsym(). All objects loaded automatically as a result of invoking dlopen() on the referenced object are also closed. The handle argument is the value returned by dlopen().
Upon successful completion, 0 is returned. If the object could not be closed, or if handle does not refer to an open object, dlclose() returns a non-zero value. Detailed diagnostic information is available through dlerror().
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
Successful invocation of dlclose() does not guarantee that the objects associated with handle will actually be removed from the address space of the actor. The same object may be opened multiple times. Objects loaded automatically when the program was started, or as a result of invoking dlopen() on another object, may also be loaded by another invocation of dlopen(). An object is not removed from the address space until all references to that object through explicit dlopen() calls have been closed and all other objects implicitly referencing that object have also been closed.
Once an object has been closed by dlclose(), referencing symbols contained in that object can cause undefined behavior.
NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO | NOTES