]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
dlopen.3: Include a shell session showing build/run in EXAMPLE
authorMichael Kerrisk <mtk.manpages@gmail.com>
Sat, 5 Dec 2015 07:11:10 +0000 (08:11 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sat, 5 Dec 2015 09:46:28 +0000 (10:46 +0100)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man3/dlopen.3

index 70c4a701ddfab2c286538f1228578f359e1cb691..2ce120f3f3e50838e9e074a49906028d51ee8cf1 100644 (file)
@@ -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>