From 95f4226b2755f1600e3bf4e32e8aa0db0886c280 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Wed, 18 Dec 2002 10:13:54 +0000 Subject: mdoc(7) police: "The .Fn function". --- lib/libc/gen/dlopen.3 | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'lib/libc/gen/dlopen.3') diff --git a/lib/libc/gen/dlopen.3 b/lib/libc/gen/dlopen.3 index c1c09e4436da..ba37c6f2c9a6 100644 --- a/lib/libc/gen/dlopen.3 +++ b/lib/libc/gen/dlopen.3 @@ -60,7 +60,9 @@ program's address space, to obtain the address bindings of symbols defined by such objects, and to remove such objects when their use is no longer required. .Pp +The .Fn dlopen +function provides access to the shared object in .Fa path , returning a descriptor that can be used for later @@ -141,7 +143,9 @@ fails, it returns a null pointer, and sets an error condition which may be interrogated with .Fn dlerror . .Pp +The .Fn dlsym +function returns the address binding of the symbol described in the null-terminated character string .Fa symbol , @@ -225,17 +229,23 @@ interface, below, should be used, since .Fn getpid is a function and not a data object.) .Pp +The .Fn dlsym +function returns a null pointer if the symbol cannot be found, and sets an error condition which may be queried with .Fn dlerror . .Pp +The .Fn dlfunc +function implements all of the behavior of .Fn dlsym , but has a return type which can be cast to a function pointer without triggering compiler diagnostics. -.Fn ( dlsym +(The +.Fn dlsym +function returns a data pointer; in the C standard, conversions between data and function pointer types are undefined. Some compilers and @@ -246,7 +256,9 @@ The precise return type of is unspecified; applications must cast it to an appropriate function pointer type. .Pp +The .Fn dlerror +function returns a null-terminated character string describing the last error that occurred during a call to .Fn dlopen , @@ -266,7 +278,9 @@ to where the second call follows the first immediately, the second call will always return a null pointer. .Pp +The .Fn dlclose +function deletes a reference to the shared object referenced by .Fa handle . If the reference count drops to 0, the object is removed from the @@ -306,12 +320,16 @@ still the case when using the (obsolete) .Fl aout option to the C language compiler. .Sh ERRORS +The .Fn dlopen , .Fn dlsym , and .Fn dlfunc +functions return a null pointer in the event of errors. +The .Fn dlclose +function returns 0 on success, or -1 if an error occurred. Whenever an error has been detected, a message detailing it can be retrieved via a call to -- cgit v1.2.3