]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man2/query_module.2
Start of man-pages-5.03: renaming .Announce and .lsm files
[thirdparty/man-pages.git] / man2 / query_module.2
index ad080b7f2bbe905f70650d94b4a8438c97a542e2..10b99a99a8b8f19ea5e83daa0a450716b7caae8a 100644 (file)
@@ -1,21 +1,29 @@
 .\" Copyright (C) 1996 Free Software Foundation, Inc.
+.\"
+.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
 .\" This file is distributed according to the GNU General Public License.
-.\" See the file COPYING in the top level source directory for details.
+.\" %%%LICENSE_END
 .\"
 .\" 2006-02-09, some reformatting by Luc Van Oostenryck; some
 .\" reformatting and rewordings by mtk
 .\"
-.TH QUERY_MODULE 2 2007-06-03 "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 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
@@ -32,7 +40,7 @@ Some operations require
 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
@@ -70,14 +78,14 @@ Returns the symbols and values exported by the kernel or the indicated
 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.
@@ -91,15 +99,15 @@ is set to the number of symbols.
 .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
@@ -111,14 +119,14 @@ is the size of the module in bytes, and
 is a mask of
 .BR MOD_RUNNING ,
 .BR MOD_AUTOCLEAN ,
-etc., that indicates the current status of the module
+and so on, that indicates the current status of the module
 (see the Linux kernel source file
 .IR include/linux/module.h ).
 .I ret
 is set to the size of the
 .I module_info
 structure.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
 On success, zero is returned.
 On error, \-1 is returned and
 .I errno
@@ -155,23 +163,37 @@ is set to the minimum size needed.
 .TP
 .B ENOSYS
 .BR query_module ()
-is not supported in this version of the kernel.
-.SH "CONFORMING TO"
+is not supported in this version of the kernel
+(e.g., the kernel is version 2.6 or later).
+.SH VERSIONS
+This system call is present on Linux only up until kernel 2.4;
+it was removed in Linux 2.6.
+.\" Removed in Linux 2.5.48
+.SH CONFORMING TO
 .BR query_module ()
 is Linux-specific.
 .SH NOTES
-This system call is only present on Linux up until kernel 2.4;
-it was removed in Linux 2.6.
-.\" Removed in Linux 2.5.48
-Some of the information that was available via
+Some of the information that was formerly available via
 .BR query_module ()
 can be obtained from
 .IR /proc/modules ,
 .IR /proc/kallsyms ,
 and the files under the directory
 .IR /sys/module .
-.SH "SEE ALSO"
+.PP
+The
+.BR query_module ()
+system call is not supported by glibc.
+No declaration is provided in glibc headers, but,
+through a quirk of history, glibc does export an ABI for this system call.
+Therefore, in order to employ this system call,
+it is sufficient to manually declare the interface in your code;
+alternatively, you can invoke the system call using
+.BR syscall (2).
+.SH SEE ALSO
 .BR create_module (2),
 .BR delete_module (2),
 .BR get_kernel_syms (2),
-.BR init_module (2)
+.BR init_module (2),
+.BR lsmod (8),
+.BR modinfo (8)