OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / original / man2 / uselib.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Modified by Michael Haardt <michael@moria.de>
26 .\" Modified 1993-07-24 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified 1996-10-22 by Eric S. Raymond <esr@thyrsus.com>
28 .\" Modified 2004-06-23 by Michael Kerrisk <mtk16@ext.canterbury.ac.nz>
29 .\" Modified 2005-01-09 by aeb
30 .\"
31 .TH USELIB 2 2005-01-09 "Linux" "Linux Programmer's Manual"
32 .SH NAME
33 uselib \- load shared library
34 .SH SYNOPSIS
35 .B #include <unistd.h>
36 .sp
37 .BI "int uselib(const char *" library );
38 .SH DESCRIPTION
39 The system call
40 .BR uselib ()
41 serves to load
42 a shared library to be used by the calling process.
43 It is given a pathname.
44 The address where to load is found
45 in the library itself.
46 The library can have any recognized
47 binary format.
48 .SH "RETURN VALUE"
49 On success, zero is returned.
50 On error, \-1 is returned, and
51 .I errno
52 is set appropriately.
53 .SH ERRORS
54 In addition to all of the error codes returned by
55 .BR open (2)
56 and
57 .BR mmap (2),
58 the following may also be returned:
59 .TP
60 .B EACCES
61 The library specified by
62 .I library
63 does not have read or execute permission, or the caller does not have
64 search permission for one of the directories in the path prefix.
65 (See also
66 .BR path_resolution (7).)
67 .TP
68 .B ENFILE
69 The system limit on the total number of open files has been reached.
70 .TP
71 .B ENOEXEC
72 The file specified by
73 .I library
74 is not an executable of known type,
75 e.g., does not have the correct magic numbers.
76 .SH "CONFORMING TO"
77 .BR uselib ()
78 is Linux-specific, and should not be used in programs
79 intended to be portable.
80 .SH NOTES
81 .BR uselib ()
82 was used by early libc startup code to load
83 the shared libraries with names found in an array of names
84 in the binary.
85 .LP
86 .\" libc 4.3.1f - changelog 1993-03-02
87 Since libc 4.3.2, startup code tries to prefix these names
88 with "/usr/lib", "/lib" and "" before giving up.
89 .\" libc 4.3.4 - changelog 1993-04-21
90 In libc 4.3.4 and later these names are looked for in the directories
91 found in
92 .BR LD_LIBRARY_PATH ,
93 and if not found there,
94 prefixes "/usr/lib", "/lib" and "/" are tried.
95 .LP
96 From libc 4.4.4 on only the library "/lib/ld.so" is loaded,
97 so that this dynamic library can load the remaining libraries needed
98 (again using this call).
99 This is also the state of affairs in libc5.
100 .LP
101 glibc2 does not use this call.
102 .SH "SEE ALSO"
103 .BR ar (1),
104 .BR gcc (1),
105 .BR ld (1),
106 .BR ldd (1),
107 .BR mmap (2),
108 .BR open (2),
109 .BR dlopen (3),
110 .BR capabilities (7),
111 .BR ld.so (8)