aboutsummaryrefslogtreecommitdiff
path: root/lib/csu/i386/dlopen.3
diff options
context:
space:
mode:
authorJohn Polstra <jdp@FreeBSD.org>1997-08-02 04:56:44 +0000
committerJohn Polstra <jdp@FreeBSD.org>1997-08-02 04:56:44 +0000
commit7e7344e2f4ebf22d7c6c4ba76a775ffc8c6c2f48 (patch)
tree8cef03aff5e54cd51ce9f4cf00818a41e368b386 /lib/csu/i386/dlopen.3
parent8889c700f314bb2d6fc652ff35a5f3d2d72f5edb (diff)
Notes
Diffstat (limited to 'lib/csu/i386/dlopen.3')
-rw-r--r--lib/csu/i386/dlopen.322
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 .
.Pp
+If
+.Fn dlsym
+is called with the special
+.Fa handle
+.Dv RTLD_NEXT ,
+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.
+.Dv RTLD_NEXT
+is useful for implementing wrappers around library functions.
+For example, a wrapper function
+.Fn getpid
+could access the
+.Dq real
+.Fn getpid
+with
+.Li dlsym(RTLD_NEXT, \&"_getpid\&") .
+.Pp
.Fn dlerror
returns a null-terminated character string describing the last error that
occurred during a call to