2011年(100)
分类: 系统运维
2011-04-27 21:53:42
dlerror()
The function dlerror() returns a human readable string describing the most recent error that occurred from dlopen(), dlsym() or dlclose() since
the last call to dlerror(). It returns NULL if no errors have occurred since initialization or since it was last called.
dlopen()
The function dlopen() loads the dynamic library file named by the null-terminated string filename and returns an opaque "handle" for the dynamic library. If filename is NULL, then the returned handle is for the main program.
One of the following two values must be included in flag:
RTLD_LAZY
Perform lazy binding. Only resolve symbols as the code that references them is executed. If the symbol is never referenced, then it is never resolved. (Lazy binding is only performed for function references; references to variables are always immediately bound when the library is loaded.)
RTLD_NOW
If this value is specified, or the environment variable LD_BIND_NOW is set to a non-empty string, all undefined symbols in the library are resolved before dlopen() returns. If this cannot be done, an error is returned.
dlsym()
The function dlsym() takes a "handle" of a dynamic library returned by dlopen() and the null-terminated symbol name, returning the address where that symbol is loaded into memory.
dlclose()
The function dlclose() decrements the reference count on the dynamic library handle handle.