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