OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / 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 2012-10-18 "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 .sp
17 .BI "int get_kernel_syms(struct kernel_sym *" table );
18 .fi
19 .SH DESCRIPTION
20 .BR Note :
21 This system call is present only in kernels before Linux 2.6.
22
23 If
24 .I table
25 is NULL,
26 .BR get_kernel_syms ()
27 returns the number of symbols available for query.
28 Otherwise, it fills in a table of structures:
29 .PP
30 .in +4n
31 .nf
32 struct kernel_sym {
33     unsigned long value;
34     char          name[60];
35 };
36 .fi
37 .in
38 .PP
39 The symbols are interspersed with magic symbols of the form
40 .BI # module-name
41 with the kernel having an empty name.
42 The value associated with a symbol of this form is the address at
43 which the module is loaded.
44 .PP
45 The symbols exported from each module follow their magic module tag
46 and the modules are returned in the reverse of the
47 order in which they were loaded.
48 .SH RETURN VALUE
49 On success, returns the number of symbols copied to
50 .IR table .
51 On error, \-1 is returned and
52 .I errno
53 is set appropriately.
54 .SH ERRORS
55 There is only one possible error return:
56 .TP
57 .B ENOSYS
58 .BR get_kernel_syms ()
59 is not supported in this version of the kernel.
60 .SH VERSIONS
61 This system call is present on Linux only up until kernel 2.4;
62 it was removed in Linux 2.6.
63 .\" Removed in Linux 2.5.48
64 .SH CONFORMING TO
65 .BR get_kernel_syms ()
66 is Linux-specific.
67 .SH BUGS
68 There is no way to indicate the size of the buffer allocated for
69 .IR table .
70 If symbols have been added to the kernel since the
71 program queried for the symbol table size, memory will be corrupted.
72 .PP
73 The length of exported symbol names is limited to 59 characters.
74 .PP
75 Because of these limitations, this system call is deprecated in
76 favor of
77 .BR query_module (2)
78 (which is itself nowadays deprecated
79 in favor of other interfaces described on its manual page).
80 .SH SEE ALSO
81 .BR create_module (2),
82 .BR delete_module (2),
83 .BR init_module (2),
84 .BR query_module (2)
85 .SH COLOPHON
86 This page is part of release 3.79 of the Linux
87 .I man-pages
88 project.
89 A description of the project,
90 information about reporting bugs,
91 and the latest version of this page,
92 can be found at
93 \%http://www.kernel.org/doc/man\-pages/.