rtld-elf: Sync with FreeBSD
[dragonfly.git] / lib / libc / gen / dlfcn.3
1 .\"     $NetBSD: dlfcn.3,v 1.30 2010/12/24 13:00:24 wiz Exp $
2 .\"
3 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
5 .\"
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Paul Kranenburg.
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
29 .\"
30 .Dd March 4, 2011
31 .Dt DLFCN 3
32 .Os
33 .Sh NAME
34 .Nm dlopen ,
35 .Nm dlclose ,
36 .Nm dlinfo ,
37 .Nm dladdr ,
38 .Nm dlsym ,
39 .Nm dlfunc ,
40 .Nm dlvsym ,
41 .Nm dl_iterate_phdr ,
42 .Nm dlerror
43 .Nd programmatic interface to the dynamic linker
44 .Sh LIBRARY
45 (These functions are not in a library.
46 They are included in every dynamically linked program automatically.)
47 .Sh SYNOPSIS
48 .In dlfcn.h
49 .Ft "void *"
50 .Fn dlopen "const char *name" "int mode"
51 .Ft "int"
52 .Fn dlclose "void *handle"
53 .Ft "int"
54 .Fn dlinfo "void * handle" "int request" "void * p"
55 .Ft "int"
56 .Fn dladdr "const void * addr" "Dl_info * dlip"
57 .Ft "void *"
58 .Fn dlsym "void * handle" "const char * name"
59 .Ft dlfunc_t
60 .Fn dlfunc "void * handle" "const char * name"
61 .Ft "void *"
62 .Fn dlvsym "void * handle" "const char * name" "const char * version"
63 .Ft "char"
64 .Fn dlerror "void"
65 .In link.h
66 .Ft "int"
67 .Fn dl_iterate_phdr "int (*callback)(struct dl_phdr_info *, size_t, void *)" "void * data"
68 .Sh DESCRIPTION
69 These functions provide an interface to the run-time linker
70 .Xr ld-elf.so 1 .
71 They allow new shared objects to be loaded into the process' address space
72 under program control.
73 .Pp
74 Please view individual man pages for more information.
75 .Pp
76 .Bd -literal
77 man 3 dlopen
78 man 3 dlclose
79 man 3 dlinfo
80 man 3 dladdr
81 man 3 dlsym
82 man 3 dlfunc
83 man 3 dlvsym
84 man 3 dl_iterate_phdr
85 man 3 dlerror
86 .Ed
87 .Sh SEE ALSO
88 .Xr ld 1 ,
89 .Xr rtld 1 ,
90 .Xr link 5 ,
91 .Xr dladdr 3 ,
92 .Xr dlinfo 3 ,
93 .Xr dlopen 3 ,
94 .Xr dlclose 3 ,
95 .Xr dlsym 3 ,
96 .Xr dlfunc 3 ,
97 .Xr dlvsym 3 ,
98 .Xr dlerror 3 ,
99 .Xr dl_iterate_phr 3
100 .Sh HISTORY
101 Some of the
102 .Nm dl*
103 functions first appeared in SunOS 4.