1USELIB(2) Linux Programmer's Manual USELIB(2)
2
3
4
6 uselib - load shared library
7
9 #include <unistd.h>
10
11 int uselib(const char *library);
12
13 Note: No declaration of this system call is provided in glibc headers;
14 see NOTES.
15
17 The system call uselib() serves to load a shared library to be used by
18 the calling process. It is given a pathname. The address where to
19 load is found in the library itself. The library can have any recog‐
20 nized binary format.
21
23 On success, zero is returned. On error, -1 is returned, and errno is
24 set to indicate the error.
25
27 In addition to all of the error codes returned by open(2) and mmap(2),
28 the following may also be returned:
29
30 EACCES The library specified by library does not have read or execute
31 permission, or the caller does not have search permission for
32 one of the directories in the path prefix. (See also path_reso‐
33 lution(7).)
34
35 ENFILE The system-wide limit on the total number of open files has been
36 reached.
37
38 ENOEXEC
39 The file specified by library is not an executable of a known
40 type; for example, it does not have the correct magic numbers.
41
43 uselib() is Linux-specific, and should not be used in programs intended
44 to be portable.
45
47 This obsolete system call is not supported by glibc. No declaration is
48 provided in glibc headers, but, through a quirk of history, glibc ver‐
49 sions before 2.23 did export an ABI for this system call. Therefore,
50 in order to employ this system call, it was sufficient to manually de‐
51 clare the interface in your code; alternatively, you could invoke the
52 system call using syscall(2).
53
54 In ancient libc versions (before glibc 2.0), uselib() was used to load
55 the shared libraries with names found in an array of names in the bi‐
56 nary.
57
58 Since Linux 3.15, this system call is available only when the kernel is
59 configured with the CONFIG_USELIB option.
60
62 ar(1), gcc(1), ld(1), ldd(1), mmap(2), open(2), dlopen(3), capabili‐
63 ties(7), ld.so(8)
64
66 This page is part of release 5.13 of the Linux man-pages project. A
67 description of the project, information about reporting bugs, and the
68 latest version of this page, can be found at
69 https://www.kernel.org/doc/man-pages/.
70
71
72
73Linux 2021-03-22 USELIB(2)