.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some
.\" reformatting and rewordings by mtk
.\"
-.TH QUERY_MODULE 2 2014-05-10 "Linux" "Linux Programmer's Manual"
+.TH QUERY_MODULE 2 2017-09-15 "Linux" "Linux Programmer's Manual"
.SH NAME
query_module \- query the kernel for various bits pertaining to modules
.SH SYNOPSIS
.nf
.B #include <linux/module.h>
-.sp
+.PP
.BI "int query_module(const char *" name ", int " which ", void *" buf ,
.BI " size_t " bufsize ", size_t *" ret );
.fi
-
+.PP
.IR Note :
-No declaration of this function is provided in glibc headers; see NOTES.
+No declaration of this system call is provided in glibc headers; see NOTES.
.SH DESCRIPTION
.IR Note :
This system call is present only in kernels before Linux 2.6.
-
+.PP
.BR query_module ()
requests information from the kernel about loadable modules.
The returned information is placed in the buffer pointed to by
to identify a currently loaded module, some allow
.I name
to be NULL, indicating the kernel proper.
-
+.PP
The following values can be specified for
.IR which :
.TP
module.
The returned buffer is an array of structures of the following form
.\" ret is set on ENOSPC
+.IP
.in +4n
-.nf
-
+.EX
struct module_symbol {
unsigned long value;
unsigned long name;
};
-.fi
+.EE
.in
.IP
followed by null-terminated strings.
.B QM_INFO
Returns miscellaneous information about the indicated module.
The output buffer format is:
+.IP
.in +4n
-.nf
-
+.EX
struct module_info {
unsigned long address;
unsigned long size;
unsigned long flags;
};
-.fi
+.EE
.in
.IP
where
.IR /proc/kallsyms ,
and the files under the directory
.IR /sys/module .
-
+.PP
The
.BR query_module ()
system call is not supported by glibc.