1 .\" Copyright (C) 1996 Free Software Foundation, Inc.
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" This file is distributed according to the GNU General Public License.
7 .\" 2006-02-09, some reformatting by Luc Van Oostenryck; some
8 .\" reformatting and rewordings by mtk
10 .TH QUERY_MODULE 2 2017-09-15 "Linux" "Linux Programmer's Manual"
12 query_module \- query the kernel for various bits pertaining to modules
15 .B #include <linux/module.h>
17 .BI "int query_module(const char *" name ", int " which ", void *" buf ,
18 .BI " size_t " bufsize ", size_t *" ret );
22 No declaration of this system call is provided in glibc headers; see NOTES.
25 This system call is present only in kernels before Linux 2.6.
28 requests information from the kernel about loadable modules.
29 The returned information is placed in the buffer pointed to by
31 The caller must specify the size of
35 The precise nature and format of the returned information
36 depend on the operation specified by
38 Some operations require
40 to identify a currently loaded module, some allow
42 to be NULL, indicating the kernel proper.
44 The following values can be specified for
48 Returns success, if the kernel supports
50 Used to probe for availability of the system call.
53 Returns the names of all loaded modules.
54 The returned buffer consists of a sequence of null-terminated strings;
56 is set to the number of
58 .\" ret is set on ENOSPC
61 Returns the names of all modules used by the indicated module.
62 The returned buffer consists of a sequence of null-terminated strings;
64 is set to the number of modules.
65 .\" ret is set on ENOSPC
68 Returns the names of all modules using the indicated module.
69 This is the inverse of
71 The returned buffer consists of a sequence of null-terminated strings;
73 is set to the number of modules.
74 .\" ret is set on ENOSPC
77 Returns the symbols and values exported by the kernel or the indicated
79 The returned buffer is an array of structures of the following form
80 .\" ret is set on ENOSPC
84 struct module_symbol {
91 followed by null-terminated strings.
94 is the character offset of the string relative to the start of
97 is set to the number of symbols.
100 Returns miscellaneous information about the indicated module.
101 The output buffer format is:
106 unsigned long address;
115 is the kernel address at which the module resides,
117 is the size of the module in bytes, and
122 and so on, that indicates the current status of the module
123 (see the Linux kernel source file
124 .IR include/linux/module.h ).
126 is set to the size of the
130 On success, zero is returned.
131 On error, \-1 is returned and
133 is set appropriately.
142 was outside the program's accessible address space.
149 is NULL (indicating "the kernel"),
150 but this is not permitted with the specified value of
152 .\" Not permitted with QM_DEPS, QM_REFS, or QM_INFO.
160 The buffer size provided was too small.
162 is set to the minimum size needed.
166 is not supported in this version of the kernel
167 (e.g., the kernel is version 2.6 or later).
169 This system call is present on Linux only up until kernel 2.4;
170 it was removed in Linux 2.6.
171 .\" Removed in Linux 2.5.48
176 Some of the information that was formerly available via
181 and the files under the directory
186 system call is not supported by glibc.
187 No declaration is provided in glibc headers, but,
188 through a quirk of history, glibc does export an ABI for this system call.
189 Therefore, in order to employ this system call,
190 it is sufficient to manually declare the interface in your code;
191 alternatively, you can invoke the system call using
194 .BR create_module (2),
195 .BR delete_module (2),
196 .BR get_kernel_syms (2),