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