HP-UX Reference (11i v1 00/12) - 3 Library Functions A-M (vol 6)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/!!!intro.3c
________________________________________________________________
___ ___
d
dlclose(3C) dlclose(3C)
NAME
dlclose - close a shared library
SYNOPSIS
cc [flag ... ] file ... -ldl [library] ...
#include <dlfcn.h>
int dlclose(void *handle);
DESCRIPTION
dlclose is one of a family of routines that give the user direct access to the dynamic linking facilities
(using the -ldl option on the compiler or ld command line). dlclose disassociates a shared object pre-
viously opened by dlopen from the current process. 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 dlo-
pen
on the referenced object (see dlopen(3C)) are also closed. handle is the value returned by a previous
invocation of dlopen.
MULTITHREAD USAGE
This routine is thread-safe.
RETURN VALUE
If the referenced object was successfully closed, dlclose returns 0. If the object could not be closed, or if
handle does not refer to an open object, dlclose returns a non-0 value. More detailed diagnostic informa-
tion is availablethrough dlerror.
WARNINGS
A successful invocation of dlclose does not guarantee that the objects associated with handle have actu-
ally been removed from the address space of the process. Objects loaded by one invocation of
dlopen
may
also be loaded by another invocation of
dlopen. The same object may also be opened multiple times. An
object is not removed from the address space until all references to that object through an explicit
dlo-
pen
invocation 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.
SEE ALSO
dlerror(3C), dlopen(3C), dlsym(3C).
Texts and Tutorials:
HP-UX Linker and Libraries Online User Guide
(See the +help option)
HP-UX Linker and Libraries User’s Guide
(See manuals(5) for ordering information)
Section 3−−148 − 1 − HP-UX Release 11i: December 2000
___
___