dlclose.3   [plain text]


.Dd Sept 25, 2004
.Dt DLCLOSE 3
.Sh NAME
.Nm dlclose
.Nd close a dynamic library or bundle
.Sh SYNOPSIS
.In dlfcn.h
.Ft int
.Fn dlclose "void* handle"
.Sh DESCRIPTION
.Fn dlclose
releases a reference to the dynamic library or bundle referenced by
.Fa handle .
If the reference count drops to 0, the bundle is removed from the
address space, and
.Fa handle
is rendered invalid.
Just before removing a dynamic library or bundle in this way, any 
termination routines in it are called.  
.Fa handle
is the value returned by a previous call to dlopen.
.Sh RETURN VALUES
If
.Fn dlclose
is successful, it returns a value of 0.
Otherwise it returns -1, and sets an error string that can be
retrived with
.Fn dlerror .
.Pp
.Sh SEE ALSO
.Xr dlopen 3
.Xr dlsym 3
.Xr dlerror 3
.Xr dyld 3
.Xr NSModule 3
.Xr NSObjectFileImage 3
.Xr ld 1
.Xr cc 1