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 2012-10-09 "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 This system call is present only in kernels before Linux 2.6.
23 requests information from the kernel about loadable modules.
24 The returned information is placed in the buffer pointed to by
26 The caller must specify the size of
30 The precise nature and format of the returned information
31 depend on the operation specified by
33 Some operations require
35 to identify a currently loaded module, some allow
37 to be NULL, indicating the kernel proper.
39 The following values can be specified for
43 Returns success, if the kernel supports
45 Used to probe for availability of the system call.
48 Returns the names of all loaded modules.
49 The returned buffer consists of a sequence of null-terminated strings;
51 is set to the number of
53 .\" ret is set on ENOSPC
56 Returns the names of all modules used by the indicated module.
57 The returned buffer consists of a sequence of null-terminated strings;
59 is set to the number of modules.
60 .\" ret is set on ENOSPC
63 Returns the names of all modules using the indicated module.
64 This is the inverse of
66 The returned buffer consists of a sequence of null-terminated strings;
68 is set to the number of modules.
69 .\" ret is set on ENOSPC
72 Returns the symbols and values exported by the kernel or the indicated
74 The returned buffer is an array of structures of the following form
75 .\" ret is set on ENOSPC
79 struct module_symbol {
86 followed by null-terminated strings.
89 is the character offset of the string relative to the start of
92 is set to the number of symbols.
95 Returns miscellaneous information about the indicated module.
96 The output buffer format is:
101 unsigned long address;
110 is the kernel address at which the module resides,
112 is the size of the module in bytes, and
117 etc., that indicates the current status of the module
118 (see the Linux kernel source file
119 .IR include/linux/module.h ).
121 is set to the size of the
125 On success, zero is returned.
126 On error, \-1 is returned and
128 is set appropriately.
137 was outside the program's accessible address space.
144 is NULL (indicating "the kernel"),
145 but this is not permitted with the specified value of
147 .\" Not permitted with QM_DEPS, QM_REFS, or QM_INFO.
155 The buffer size provided was too small.
157 is set to the minimum size needed.
161 is not supported in this version of the kernel.
166 This system call is only present on Linux up until kernel 2.4;
167 it was removed in Linux 2.6.
168 .\" Removed in Linux 2.5.48
169 Some of the information that was available via
174 and the files under the directory
177 .BR create_module (2),
178 .BR delete_module (2),
179 .BR get_kernel_syms (2),