diff options
| author | John Polstra <jdp@FreeBSD.org> | 1999-04-07 02:43:11 +0000 |
|---|---|---|
| committer | John Polstra <jdp@FreeBSD.org> | 1999-04-07 02:43:11 +0000 |
| commit | 14f5fa0596e0036d478bfa9a560e7d14ba6091e0 (patch) | |
| tree | ec7f016d0db8c362aba356cb806671bf3b533ad5 /lib | |
| parent | b2e2337ba1ba2558fdbedb475102d80b259e422f (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libc/gen/dlfcn.c | 17 | ||||
| -rw-r--r-- | lib/libc/gen/dlopen.3 | 19 |
2 files changed, 34 insertions, 2 deletions
diff --git a/lib/libc/gen/dlfcn.c b/lib/libc/gen/dlfcn.c index 79021e76b1e4..38b9553679a4 100644 --- a/lib/libc/gen/dlfcn.c +++ b/lib/libc/gen/dlfcn.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: dlfcn.c,v 1.1 1998/02/09 06:05:24 jdp Exp $ + * $Id: dlfcn.c,v 1.2 1998/03/07 19:57:05 jdp Exp $ */ /* @@ -94,6 +94,14 @@ dlsym(void *handle, const char *name) return NULL; } +#pragma weak dlversion +int +dlversion(void) +{ + _rtld_error(sorry); + return 0; +} + #else /* a.out format */ #include <sys/types.h> @@ -165,4 +173,11 @@ dlsym(void *handle, const char *name) return (__ldso_entry->dlsym)(handle, name); } +/* We don't support dlversion() on a.out systems. */ +int +dlversion(void) +{ + return 0; +} + #endif /* __ELF__ */ diff --git a/lib/libc/gen/dlopen.3 b/lib/libc/gen/dlopen.3 index 9e848f9e8428..e56e3aeb9b98 100644 --- a/lib/libc/gen/dlopen.3 +++ b/lib/libc/gen/dlopen.3 @@ -34,7 +34,7 @@ .Os FreeBSD .Dt DLOPEN 3 .Sh NAME -.Nm dlopen, dlsym, dlerror, dlclose +.Nm dlopen, dlsym, dlerror, dlclose, dlversion .Nd programmatic interface to the dynamic linker .Sh SYNOPSIS .Fd #include <dlfcn.h> @@ -46,6 +46,8 @@ .Fn dlerror "void" .Ft int .Fn dlclose "void *handle" +.Ft int +.Fn dlversion "void" .Sh DESCRIPTION These functions provide a simple programmatic interface to the services of the dynamic linker. @@ -219,6 +221,19 @@ The object-intrinsic functions and .Fn _fini are called with no arguments, and are not expected to return values. +.Pp +.Fn dlversion +returns the version number of the dynamic linker. Interpreted +as a decimal number, the version number has the form +.Em rrrsss . +.Em rrr +corresponds to the base operating system release version, e.g., 400 +for release 4.0.0. +.Em sss +is a serial number that increases monotonically within each release +version. If the installed dynamic linker is too old to support +.Fn dlversion , +0 is returned. .Sh NOTES ELF executables need to be linked using the @@ -234,6 +249,8 @@ and return the null pointer in the event of errors. .Fn dlclose returns 0 on success, or -1 if an error occurred. +.Fn dlversion +returns 0 if the dynamic linker is too old to support it. Whenever an error has been detected, a message detailing it can be retrieved via a call to .Fn dlerror . |
