]> 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 4e39c1b8b5cda96328dbb9f2e0f62b24bdeb2d20..10b99a99a8b8f19ea5e83daa0a450716b7caae8a 100644 (file)
@@ -1,26 +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 2012-10-18 "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 :
-There is no glibc wrapper for this system call; see NOTES.
+No declaration of this system call is provided in glibc headers; see NOTES.
 .SH DESCRIPTION
-.BR Note :
+.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
@@ -37,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
@@ -75,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.
@@ -96,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
@@ -116,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
@@ -163,10 +166,10 @@ is set to the minimum size needed.
 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 only present on Linux up until kernel 2.4;
+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"
+.SH CONFORMING TO
 .BR query_module ()
 is Linux-specific.
 .SH NOTES
@@ -177,11 +180,17 @@ can be obtained from
 .IR /proc/kallsyms ,
 and the files under the directory
 .IR /sys/module .
-
-Glibc does not provide a wrapper for this system call;
-in the unlikely event that you need to use it on an old kernel, use
+.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"
+.SH SEE ALSO
 .BR create_module (2),
 .BR delete_module (2),
 .BR get_kernel_syms (2),