Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Dynamic Linking Library Functionsdlclose(3DL)


NAME

 dlclose - close a shared object

SYNOPSIS

 
cc [ flag ... ] file ... -ldl [ library ... ]
#include <dlfcn.h>
int dlclose(void *handle);

DESCRIPTION

 

The dlclose() function disassociates a shared object previously 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 dlopen() on the referenced object are also closed. handle is the value returned by a previous invocation of dlopen().

RETURN VALUES

 

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-zero value. More detailed diagnostic information will be available through dlerror().

USAGE

 

The dlclose() function is one of a family of functions that give the user direct access to the dynamic linking facilities (see Linker and Libraries Guide) and are available to dynamically-linked processes only.

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelMT-Safe

SEE ALSO

 

ld(1), dladdr(3DL), dldump(3DL), dlerror(3DL), dlopen(3DL), dlsym(3DL), attributes(5)

Linker and Libraries Guide

NOTES

 

A successful invocation of dlclose() does not guarantee that the objects associated with handle will actually be 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 will not be removed from the address space until all references to that object through an explicit dlopen() 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.


SunOS 5.9Go To TopLast Changed 31 Dec 1996

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.