1 .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\" Modified by Michael Haardt <michael@moria.de>
6 .\" Modified 1993-07-24 by Rik Faith <faith@cs.unc.edu>
7 .\" Modified 1996-10-22 by Eric S. Raymond <esr@thyrsus.com>
8 .\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
9 .\" Modified 2005-01-09 by aeb
11 .TH USELIB 2 2021-03-22 "Linux man-pages (unreleased)"
13 uselib \- load shared library
16 .B #include <unistd.h>
18 .BI "int uselib(const char *" library );
22 No declaration of this system call is provided in glibc headers; see NOTES.
27 a shared library to be used by the calling process.
28 It is given a pathname.
29 The address where to load is found
30 in the library itself.
31 The library can have any recognized
34 On success, zero is returned.
35 On error, \-1 is returned, and
37 is set to indicate the error.
39 In addition to all of the error codes returned by
43 the following may also be returned:
46 The library specified by
48 does not have read or execute permission, or the caller does not have
49 search permission for one of the directories in the path prefix.
51 .BR path_resolution (7).)
54 The system-wide limit on the total number of open files has been reached.
59 is not an executable of a known type;
60 for example, it does not have the correct magic numbers.
63 is Linux-specific, and should not be used in programs
64 intended to be portable.
66 This obsolete system call is not supported by glibc.
67 No declaration is provided in glibc headers, but, through a quirk of history,
68 glibc versions before 2.23 did export an ABI for this system call.
69 Therefore, in order to employ this system call,
70 it was sufficient to manually declare the interface in your code;
71 alternatively, you could invoke the system call using
74 In ancient libc versions (before glibc 2.0),
77 the shared libraries with names found in an array of names
80 .\" .\" libc 4.3.1f - changelog 1993-03-02
81 .\" Since libc 4.3.2, startup code tries to prefix these names
82 .\" with "/usr/lib", "/lib" and "" before giving up.
83 .\" .\" libc 4.3.4 - changelog 1993-04-21
84 .\" In libc 4.3.4 and later these names are looked for in the directories
86 .\" .BR LD_LIBRARY_PATH ,
87 .\" and if not found there,
88 .\" prefixes "/usr/lib", "/lib" and "/" are tried.
90 .\" From libc 4.4.4 on only the library "/lib/ld.so" is loaded,
91 .\" so that this dynamic library can load the remaining libraries needed
92 .\" (again using this call).
93 .\" This is also the state of affairs in libc5.
95 .\" glibc2 does not use this call.
98 .\" commit 69369a7003735d0d8ef22097e27a55a8bad9557a
99 this system call is available only when the kernel is configured with the
110 .BR capabilities (7),