1 .\" Copyright (C) 1996 Free Software Foundation, Inc.
3 .\" SPDX-License-Identifier: GPL-1.0-or-later
5 .\" 2006-02-09, some reformatting by Luc Van Oostenryck; some
6 .\" reformatting and rewordings by mtk
8 .TH QUERY_MODULE 2 2022-09-09 "Linux man-pages (unreleased)"
10 query_module \- query the kernel for various bits pertaining to modules
13 .B #include <linux/module.h>
15 .BI "[[deprecated]] int query_module(const char *" name ", int " which \
17 .BI " size_t " bufsize ", size_t *" ret );
21 This system call is present only in kernels before Linux 2.6.
24 requests information from the kernel about loadable modules.
25 The returned information is placed in the buffer pointed to by
27 The caller must specify the size of
31 The precise nature and format of the returned information
32 depend on the operation specified by
34 Some operations require
36 to identify a currently loaded module, some allow
38 to be NULL, indicating the kernel proper.
40 The following values can be specified for
44 Returns success, if the kernel supports
46 Used to probe for availability of the system call.
49 Returns the names of all loaded modules.
50 The returned buffer consists of a sequence of null-terminated strings;
52 is set to the number of
54 .\" ret is set on ENOSPC
57 Returns the names of all modules used by the indicated module.
58 The returned buffer consists of a sequence of null-terminated strings;
60 is set to the number of modules.
61 .\" ret is set on ENOSPC
64 Returns the names of all modules using the indicated module.
65 This is the inverse of
67 The returned buffer consists of a sequence of null-terminated strings;
69 is set to the number of modules.
70 .\" ret is set on ENOSPC
73 Returns the symbols and values exported by the kernel or the indicated
75 The returned buffer is an array of structures of the following form
76 .\" ret is set on ENOSPC
80 struct module_symbol {
87 followed by null-terminated strings.
90 is the character offset of the string relative to the start of
93 is set to the number of symbols.
96 Returns miscellaneous information about the indicated module.
97 The output buffer format is:
102 unsigned long address;
111 is the kernel address at which the module resides,
113 is the size of the module in bytes, and
118 and so on, that indicates the current status of the module
119 (see the Linux kernel source file
120 .IR include/linux/module.h ).
122 is set to the size of the
126 On success, zero is returned.
127 On error, \-1 is returned and
129 is set to indicate the error.
138 was outside the program's accessible address space.
145 is NULL (indicating "the kernel"),
146 but this is not permitted with the specified value of
148 .\" Not permitted with QM_DEPS, QM_REFS, or QM_INFO.
156 The buffer size provided was too small.
158 is set to the minimum size needed.
162 is not supported in this version of the kernel
163 (e.g., the kernel is version 2.6 or later).
165 This system call is present on Linux only up until kernel 2.4;
166 it was removed in Linux 2.6.
167 .\" Removed in Linux 2.5.48
172 Some of the information that was formerly available via
177 and the files under the directory
182 system call is not supported by glibc.
183 No declaration is provided in glibc headers, but,
184 through a quirk of history, glibc does export an ABI for this system call.
185 Therefore, in order to employ this system call,
186 it is sufficient to manually declare the interface in your code;
187 alternatively, you can invoke the system call using
190 .BR create_module (2),
191 .BR delete_module (2),
192 .BR get_kernel_syms (2),