]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/get_kernel_syms.2
_syscall.2, bpf.2, cacheflush.2, capget.2, chdir.2, chmod.2, chroot.2, clock_getres...
[thirdparty/man-pages.git] / man2 / get_kernel_syms.2
1 .\" Copyright (C) 1996 Free Software Foundation, Inc.
2 .\"
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" This file is distributed according to the GNU General Public License.
5 .\" %%%LICENSE_END
6 .\"
7 .\" 2006-02-09, some reformatting by Luc Van Oostenryck; some
8 .\" reformatting and rewordings by mtk
9 .\"
10 .TH GET_KERNEL_SYMS 2 2016-10-08 "Linux" "Linux Programmer's Manual"
11 .SH NAME
12 get_kernel_syms \- retrieve exported kernel and module symbols
13 .SH SYNOPSIS
14 .nf
15 .B #include <linux/module.h>
16 .PP
17 .BI "int get_kernel_syms(struct kernel_sym *" table );
18 .fi
19 .PP
20 .IR Note :
21 No declaration of this system call is provided in glibc headers; see NOTES.
22 .SH DESCRIPTION
23 .BR Note :
24 This system call is present only in kernels before Linux 2.6.
25 .PP
26 If
27 .I table
28 is NULL,
29 .BR get_kernel_syms ()
30 returns the number of symbols available for query.
31 Otherwise, it fills in a table of structures:
32 .PP
33 .in +4n
34 .nf
35 struct kernel_sym {
36 unsigned long value;
37 char name[60];
38 };
39 .fi
40 .in
41 .PP
42 The symbols are interspersed with magic symbols of the form
43 .BI # module-name
44 with the kernel having an empty name.
45 The value associated with a symbol of this form is the address at
46 which the module is loaded.
47 .PP
48 The symbols exported from each module follow their magic module tag
49 and the modules are returned in the reverse of the
50 order in which they were loaded.
51 .SH RETURN VALUE
52 On success, returns the number of symbols copied to
53 .IR table .
54 On error, \-1 is returned and
55 .I errno
56 is set appropriately.
57 .SH ERRORS
58 There is only one possible error return:
59 .TP
60 .B ENOSYS
61 .BR get_kernel_syms ()
62 is not supported in this version of the kernel.
63 .SH VERSIONS
64 This system call is present on Linux only up until kernel 2.4;
65 it was removed in Linux 2.6.
66 .\" Removed in Linux 2.5.48
67 .SH CONFORMING TO
68 .BR get_kernel_syms ()
69 is Linux-specific.
70 .SH NOTES
71 This obsolete system call is not supported by glibc.
72 No declaration is provided in glibc headers, but, through a quirk of history,
73 glibc versions before 2.23 did export an ABI for this system call.
74 Therefore, in order to employ this system call,
75 it was sufficient to manually declare the interface in your code;
76 alternatively, you could invoke the system call using
77 .BR syscall (2).
78 .SH BUGS
79 There is no way to indicate the size of the buffer allocated for
80 .IR table .
81 If symbols have been added to the kernel since the
82 program queried for the symbol table size, memory will be corrupted.
83 .PP
84 The length of exported symbol names is limited to 59 characters.
85 .PP
86 Because of these limitations, this system call is deprecated in
87 favor of
88 .BR query_module (2)
89 (which is itself nowadays deprecated
90 in favor of other interfaces described on its manual page).
91 .SH SEE ALSO
92 .BR create_module (2),
93 .BR delete_module (2),
94 .BR init_module (2),
95 .BR query_module (2)