]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/get_kernel_syms.2
grfix
[thirdparty/man-pages.git] / man2 / get_kernel_syms.2
CommitLineData
c4d4162c
MK
1.\" Copyright (C) 1996 Free Software Foundation, Inc.
2.\" This file is distributed according to the GNU General Public License.
3.\" See the file COPYING in the top level source directory for details.
4.\"
c13182ef 5.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some
c4d4162c
MK
6.\" reformatting and rewordings by mtk
7.\"
7190cf21 8.TH GET_KERNEL_SYMS 2 2007-06-03 "Linux" "Linux Programmer's Manual"
c4d4162c
MK
9.SH NAME
10get_kernel_syms \- retrieve exported kernel and module symbols
11.SH SYNOPSIS
12.nf
13.B #include <linux/module.h>
14.sp
15.BI "int get_kernel_syms(struct kernel_sym *" table );
16.fi
17.SH DESCRIPTION
18If
19.I table
20is NULL,
21.BR get_kernel_syms ()
22returns the number of symbols available for query.
23Otherwise it fills in a table of structures:
24.PP
3f89ebc0 25.in +4n
c4d4162c
MK
26.nf
27struct kernel_sym {
28 unsigned long value;
29 char name[60];
30};
31.fi
3f89ebc0 32.in
c4d4162c
MK
33.PP
34The symbols are interspersed with magic symbols of the form
35.BI # module-name
36with the kernel having an empty name.
37The value associated with a symbol of this form is the address at
38which the module is loaded.
39.PP
40The symbols exported from each module follow their magic module tag
c13182ef 41and the modules are returned in the reverse of the
c4d4162c
MK
42order in which they were loaded.
43.SH "RETURN VALUE"
78f2eeab 44On success, returns the number of symbols copied to
c13182ef 45.IR table .
78f2eeab
MK
46On error, \-1 is returned and
47.I errno
48is set appropriately.
6686472b 49.SH ERRORS
78f2eeab
MK
50There is only one possible error return:
51.TP
52.B ENOSYS
53.BR get_kernel_syms ()
54is not supported in this version of the kernel.
a1d5f77c
MK
55.SH VERSIONS
56This system call is only present on Linux up until kernel 2.4;
57it was removed in Linux 2.6.
ceaeac24 58.\" Removed in Linux 2.5.48
c4d4162c
MK
59.SH "CONFORMING TO"
60.BR get_kernel_syms ()
61is Linux specific.
62.SH BUGS
63There is no way to indicate the size of the buffer allocated for
64.IR table .
65If symbols have been added to the kernel since the
66program queried for the symbol table size, memory will be corrupted.
67.PP
68The length of exported symbol names is limited to 59 characters.
69.PP
70Because of these limitations, this system call is deprecated in
71favor of
72.BR query_module (2)
73(which is itself nowadays deprecated
74in favor of other interfaces described on its manual page).
c4d4162c
MK
75.SH "SEE ALSO"
76.BR create_module (2),
77.BR delete_module (2),
78.BR init_module (2),
79.BR query_module (2)