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.
5 .\" 2006-02-09, some reformatting by Luc Van Oostenryck; some
6 .\" reformatting and rewordings by mtk
8 .TH QUERY_MODULE 2 2013-01-27 "Linux" "Linux Programmer's Manual"
10 query_module \- query the kernel for various bits pertaining to modules
13 .B #include <linux/module.h>
15 .BI "int query_module(const char *" name ", int " which ", void *" buf ,
16 .BI " size_t " bufsize ", size_t *" ret );
20 There is no glibc wrapper for this system call; see NOTES.
23 This system call is present only in kernels before Linux 2.6.
26 requests information from the kernel about loadable modules.
27 The returned information is placed in the buffer pointed to by
29 The caller must specify the size of
33 The precise nature and format of the returned information
34 depend on the operation specified by
36 Some operations require
38 to identify a currently loaded module, some allow
40 to be NULL, indicating the kernel proper.
42 The following values can be specified for
46 Returns success, if the kernel supports
48 Used to probe for availability of the system call.
51 Returns the names of all loaded modules.
52 The returned buffer consists of a sequence of null-terminated strings;
54 is set to the number of
56 .\" ret is set on ENOSPC
59 Returns the names of all modules used by the indicated module.
60 The returned buffer consists of a sequence of null-terminated strings;
62 is set to the number of modules.
63 .\" ret is set on ENOSPC
66 Returns the names of all modules using the indicated module.
67 This is the inverse of
69 The returned buffer consists of a sequence of null-terminated strings;
71 is set to the number of modules.
72 .\" ret is set on ENOSPC
75 Returns the symbols and values exported by the kernel or the indicated
77 The returned buffer is an array of structures of the following form
78 .\" ret is set on ENOSPC
82 struct module_symbol {
89 followed by null-terminated strings.
92 is the character offset of the string relative to the start of
95 is set to the number of symbols.
98 Returns miscellaneous information about the indicated module.
99 The output buffer format is:
104 unsigned long address;
113 is the kernel address at which the module resides,
115 is the size of the module in bytes, and
120 etc., that indicates the current status of the module
121 (see the Linux kernel source file
122 .IR include/linux/module.h ).
124 is set to the size of the
128 On success, zero is returned.
129 On error, \-1 is returned and
131 is set appropriately.
140 was outside the program's accessible address space.
147 is NULL (indicating "the kernel"),
148 but this is not permitted with the specified value of
150 .\" Not permitted with QM_DEPS, QM_REFS, or QM_INFO.
158 The buffer size provided was too small.
160 is set to the minimum size needed.
164 is not supported in this version of the kernel
165 (e.g., the kernel is version 2.6 or later).
167 This system call is only present on Linux up until kernel 2.4;
168 it was removed in Linux 2.6.
169 .\" Removed in Linux 2.5.48
174 Some of the information that was formerly available via
179 and the files under the directory
182 Glibc does not provide a wrapper for this system call;
183 in the unlikely event that you need to use it on an old kernel, use
186 .BR create_module (2),
187 .BR delete_module (2),
188 .BR get_kernel_syms (2),