]>
Commit | Line | Data |
---|---|---|
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 |
10 | get_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 | |
18 | If | |
19 | .I table | |
20 | is NULL, | |
21 | .BR get_kernel_syms () | |
22 | returns the number of symbols available for query. | |
23 | Otherwise it fills in a table of structures: | |
24 | .PP | |
3f89ebc0 | 25 | .in +4n |
c4d4162c MK |
26 | .nf |
27 | struct kernel_sym { | |
28 | unsigned long value; | |
29 | char name[60]; | |
30 | }; | |
31 | .fi | |
3f89ebc0 | 32 | .in |
c4d4162c MK |
33 | .PP |
34 | The symbols are interspersed with magic symbols of the form | |
35 | .BI # module-name | |
36 | with the kernel having an empty name. | |
37 | The value associated with a symbol of this form is the address at | |
38 | which the module is loaded. | |
39 | .PP | |
40 | The symbols exported from each module follow their magic module tag | |
c13182ef | 41 | and the modules are returned in the reverse of the |
c4d4162c MK |
42 | order in which they were loaded. |
43 | .SH "RETURN VALUE" | |
78f2eeab | 44 | On success, returns the number of symbols copied to |
c13182ef | 45 | .IR table . |
78f2eeab MK |
46 | On error, \-1 is returned and |
47 | .I errno | |
48 | is set appropriately. | |
6686472b | 49 | .SH ERRORS |
78f2eeab MK |
50 | There is only one possible error return: |
51 | .TP | |
52 | .B ENOSYS | |
53 | .BR get_kernel_syms () | |
54 | is not supported in this version of the kernel. | |
a1d5f77c MK |
55 | .SH VERSIONS |
56 | This system call is only present on Linux up until kernel 2.4; | |
57 | it 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 () | |
61 | is Linux specific. | |
62 | .SH BUGS | |
63 | There is no way to indicate the size of the buffer allocated for | |
64 | .IR table . | |
65 | If symbols have been added to the kernel since the | |
66 | program queried for the symbol table size, memory will be corrupted. | |
67 | .PP | |
68 | The length of exported symbol names is limited to 59 characters. | |
69 | .PP | |
70 | Because of these limitations, this system call is deprecated in | |
71 | favor of | |
72 | .BR query_module (2) | |
73 | (which is itself nowadays deprecated | |
74 | in 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) |