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 .TH QUERY_MODULE 2 "26 Dec 1996" "Linux 2.1.17" "Linux Module Support"
7 query_module \- query the kernel for various bits pertaining to modules.
10 .B #include <linux/module.h>
12 \fBint query_module(const char *\fIname\fB, int \fIwhich\fB,
13 void *\fIbuf\fB, size_t \fIbufsize\fB, size_t *\fIret\fB);
17 requests information related to loadable modules from the kernel. The
18 precise nature of the information and its format depends on the \fIwhich\fP
19 sub function. Some functions require \fIname\fP to name a currently
20 loaded module, some allow \fIname\fP to be \fBNULL\fP indicating the
26 Always returns success. Used to probe for the system call.
29 Returns the names of all loaded modules. The output buffer format is
30 adjacent null-terminated strings; \fIret\fP is set to the number of
34 Returns the names of all modules used by the indicated module. The
35 output buffer format is adjacent null-terminated strings; \fIret\fP is
36 set to the number of modules.
39 Returns the names of all modules using the indicated module. This is
40 the inverse of \fBQM_DEPS\fP. The output buffer format is adjacent
41 null-terminated strings; \fIret\fP is set to the number of modules.
44 Returns the symbols and values exported by the kernel or the indicated
45 module. The buffer format is an array of:
56 followed by null-terminated strings. The value of \fIname\fP is the
57 character offset of the string relative to the start of \fIbuf\fP;
58 \fIret\fP is set to the number of symbols.
62 Returns miscellaneous information about the indicated module. The output
69 unsigned long address;
75 where \fIaddress\fP is the kernel address at which the module resides,
76 \fIsize\fP is the size of the module in bytes, and \fIflags\fP is
77 a mask of \fBMOD_RUNNING\fP, \fBMOD_AUTOCLEAN\fP, et al that indicates
78 the current status of the module. \fIret\fP is set to the size of
79 the \fBmodule_info\fP struct.
82 On success, zero is returned. On error, \-1 is returned and \fIerrno\fP
87 No module by that \fIname\fP exists.
90 Invalid \fIwhich\fP, or \fIname\fP indicates the kernel for an
91 inappropriate sub function.
94 The buffer size provided was too small. \fIret\fP is set to the
98 At least one of \fIname\fP, \fIbuf\fP, or \fIret\fP was
99 outside the program's accessible address space.
101 .BR create_module "(2), " init_module "(2), " delete_module "(2).