Debian Codegraph @

upstream/debian-trixie/man2/uselib.2

raw
1 .\" Copyright (c) 1992 Drew Eckhardt ([email protected]), March 28, 1992
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .\" Modified by Michael Haardt <[email protected]>
6 .\" Modified 1993-07-24 by Rik Faith <[email protected]>
7 .\" Modified 1996-10-22 by Eric S. Raymond <[email protected]>
8 .\" Modified 2004-06-23 by Michael Kerrisk <[email protected]>
9 .\" Modified 2005-01-09 by aeb
10 .\"
11 .TH uselib 2 2024-05-02 "Linux man-pages 6.9.1"
12 .SH NAME
13 uselib \- load shared library
14 .SH SYNOPSIS
15 .nf
16 .B #include <unistd.h>
17 .P
18 .BI "[[deprecated]] int uselib(const char *" library );
19 .fi
20 .SH DESCRIPTION
21 The system call
22 .BR uselib ()
23 serves to load
24 a shared library to be used by the calling process.
25 It is given a pathname.
26 The address where to load is found
27 in the library itself.
28 The library can have any recognized
29 binary format.
30 .SH RETURN VALUE
31 On success, zero is returned.
32 On error, \-1 is returned, and
33 .I errno
34 is set to indicate the error.
35 .SH ERRORS
36 In addition to all of the error codes returned by
37 .BR open (2)
38 and
39 .BR mmap (2),
40 the following may also be returned:
41 .TP
42 .B EACCES
43 The library specified by
44 .I library
45 does not have read or execute permission, or the caller does not have
46 search permission for one of the directories in the path prefix.
47 (See also
48 .BR path_resolution (7).)
49 .TP
50 .B ENFILE
51 The system-wide limit on the total number of open files has been reached.
52 .TP
53 .B ENOEXEC
54 The file specified by
55 .I library
56 is not an executable of a known type;
57 for example, it does not have the correct magic numbers.
58 .SH STANDARDS
59 Linux.
60 .SH HISTORY
61 This obsolete system call is not supported by glibc.
62 No declaration is provided in glibc headers, but, through a quirk of history,
63 glibc before glibc 2.23 did export an ABI for this system call.
64 Therefore, in order to employ this system call,
65 it was sufficient to manually declare the interface in your code;
66 alternatively, you could invoke the system call using
67 .BR syscall (2).
68 .P
69 In ancient libc versions (before glibc 2.0),
70 .BR uselib ()
71 was used to load
72 the shared libraries with names found in an array of names
73 in the binary.
74 .\" .P
75 .\" .\" libc 4.3.1f - changelog 1993-03-02
76 .\" Since libc 4.3.2, startup code tries to prefix these names
77 .\" with "/usr/lib", "/lib" and "" before giving up.
78 .\" .\" libc 4.3.4 - changelog 1993-04-21
79 .\" In libc 4.3.4 and later these names are looked for in the directories
80 .\" found in
81 .\" .BR LD_LIBRARY_PATH ,
82 .\" and if not found there,
83 .\" prefixes "/usr/lib", "/lib" and "/" are tried.
84 .\" .P
85 .\" From libc 4.4.4 on only the library "/lib/ld.so" is loaded,
86 .\" so that this dynamic library can load the remaining libraries needed
87 .\" (again using this call).
88 .\" This is also the state of affairs in libc5.
89 .\" .P
90 .\" glibc2 does not use this call.
91 .P
92 Since Linux 3.15,
93 .\" commit 69369a7003735d0d8ef22097e27a55a8bad9557a
94 this system call is available only when the kernel is configured with the
95 .B CONFIG_USELIB
96 option.
97 .SH SEE ALSO
98 .BR ar (1),
99 .BR gcc (1),
100 .BR ld (1),
101 .BR ldd (1),
102 .BR mmap (2),
103 .BR open (2),
104 .BR dlopen (3),
105 .BR capabilities (7),
106 .BR ld.so (8)