1GET_KERNEL_SYMS(2) Linux Programmer's Manual GET_KERNEL_SYMS(2)
2
3
4
6 get_kernel_syms - retrieve exported kernel and module symbols
7
9 #include <linux/module.h>
10
11 int get_kernel_syms(struct kernel_sym *table);
12
13 Note: No declaration of this system call is provided in glibc headers;
14 see NOTES.
15
17 Note: This system call is present only in kernels before Linux 2.6.
18
19 If table is NULL, get_kernel_syms() returns the number of symbols
20 available for query. Otherwise, it fills in a table of structures:
21
22 struct kernel_sym {
23 unsigned long value;
24 char name[60];
25 };
26
27 The symbols are interspersed with magic symbols of the form #module-
28 name with the kernel having an empty name. The value associated with a
29 symbol of this form is the address at which the module is loaded.
30
31 The symbols exported from each module follow their magic module tag and
32 the modules are returned in the reverse of the order in which they were
33 loaded.
34
36 On success, returns the number of symbols copied to table. On error,
37 -1 is returned and errno is set appropriately.
38
40 There is only one possible error return:
41
42 ENOSYS get_kernel_syms() is not supported in this version of the ker‐
43 nel.
44
46 This system call is present on Linux only up until kernel 2.4; it was
47 removed in Linux 2.6.
48
50 get_kernel_syms() is Linux-specific.
51
53 This obsolete system call is not supported by glibc. No declaration is
54 provided in glibc headers, but, through a quirk of history, glibc ver‐
55 sions before 2.23 did export an ABI for this system call. Therefore,
56 in order to employ this system call, it was sufficient to manually
57 declare the interface in your code; alternatively, you could invoke the
58 system call using syscall(2).
59
61 There is no way to indicate the size of the buffer allocated for table.
62 If symbols have been added to the kernel since the program queried for
63 the symbol table size, memory will be corrupted.
64
65 The length of exported symbol names is limited to 59 characters.
66
67 Because of these limitations, this system call is deprecated in favor
68 of query_module(2) (which is itself nowadays deprecated in favor of
69 other interfaces described on its manual page).
70
72 create_module(2), delete_module(2), init_module(2), query_module(2)
73
75 This page is part of release 5.04 of the Linux man-pages project. A
76 description of the project, information about reporting bugs, and the
77 latest version of this page, can be found at
78 https://www.kernel.org/doc/man-pages/.
79
80
81
82Linux 2017-09-15 GET_KERNEL_SYMS(2)