aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--man3/dlopen.315
1 files changed, 14 insertions, 1 deletions
diff --git a/man3/dlopen.3 b/man3/dlopen.3
index 70c4a701dd..2ce120f3f3 100644
--- a/man3/dlopen.3
+++ b/man3/dlopen.3
@@ -499,7 +499,20 @@ called when a shared object is unloaded.
.SS History
These functions are part of the dlopen API, derived from SunOS.
.SH EXAMPLE
-Load the (glibc) math library, and print the cosine of 2.0:
+The program below loads the (glibc) math library,
+looks up the address of the
+.BR cos (3)
+function, and prints the cosine of 2.0.
+The following is an example of building and running the program:
+
+.in +4n
+.nf
+$ \fBcc dlopen_demo.c \-ldl\fP
+$ \fB./a.out\fP
+\-0.416147
+.fi
+.in
+.SS Program source
.nf
#include <stdio.h>