path: root/lib/csu/i386/dlopen.3
diff options
Diffstat (limited to 'lib/csu/i386/dlopen.3')
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/csu/i386/dlopen.3 b/lib/csu/i386/dlopen.3
index 82651c6b510f..efd59be557f2 100644
--- a/lib/csu/i386/dlopen.3
+++ b/lib/csu/i386/dlopen.3
@@ -152,6 +152,28 @@ returns a null pointer if the symbol cannot be found, and sets an error
condition which may be queried with
.Fn dlerror .
+.Fn dlsym
+is called with the special
+.Fa handle
+then the search for the symbol is limited to the shared objects
+which were loaded after the one issuing the call to
+.Fn dlsym .
+Thus, if the function is called from the main program, all
+the shared libraries are searched.
+If it is called from a shared library, all subsequent shared
+libraries are searched.
+is useful for implementing wrappers around library functions.
+For example, a wrapper function
+.Fn getpid
+could access the
+.Dq real
+.Fn getpid
+.Li dlsym(RTLD_NEXT, \&"_getpid\&") .
.Fn dlerror
returns a null-terminated character string describing the last error that
occurred during a call to