mirror of https://github.com/mkerrisk/man-pages
init_module.2: Changes after review comments from Rusty Russell
Reviewed-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
27ad8f18a5
commit
0cb430a1e5
|
@ -65,6 +65,7 @@ flag is always specified, and the
|
|||
flag may additionally be specified.
|
||||
.\" O_TRUNC == KMOD_REMOVE_FORCE in kmod library
|
||||
.\" O_NONBLOCK == KMOD_REMOVE_NOWAIT in kmod library
|
||||
|
||||
The various combinations for
|
||||
.I flags
|
||||
have the following effect:
|
||||
|
@ -77,7 +78,7 @@ The call returns immediately, with an error.
|
|||
The module is unloaded immediately,
|
||||
regardless of whether it has a nonzero reference count.
|
||||
.TP
|
||||
.B flags == 0
|
||||
.B (flags & O_NONBLOCK) == 0
|
||||
If
|
||||
.I flags
|
||||
does not specify
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
.\" 2006-02-09, some reformatting by Luc Van Oostenryck; some
|
||||
.\" reformatting and rewordings by mtk
|
||||
.\"
|
||||
.TH INIT_MODULE 2 2012-10-09 "Linux" "Linux Programmer's Manual"
|
||||
.TH INIT_MODULE 2 2012-10-12 "Linux" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
init_module \- load a kernel module
|
||||
.SH SYNOPSIS
|
||||
|
@ -38,9 +38,12 @@ The module image should be a valid ELF image, built for the running kernel.
|
|||
The
|
||||
.I param_values
|
||||
argument is a string containing space-delimited specifications of the
|
||||
values for module parameters.
|
||||
values for module parameters (defined inside the module using
|
||||
.BR module_param ()
|
||||
and
|
||||
.BR module_param_array ()).
|
||||
The kernel parses this string and initializes the specified
|
||||
parameters
|
||||
parameters.
|
||||
Each of the parameter specifications has the form:
|
||||
|
||||
.RI " " name [ =value [ ,value ...]]
|
||||
|
@ -63,35 +66,36 @@ is set appropriately.
|
|||
.SH ERRORS
|
||||
.TP
|
||||
.B EBUSY
|
||||
The module's initialization routine failed.
|
||||
Timeout while trying to resolve a symbol reference by this module.
|
||||
.TP
|
||||
.B EEXIST
|
||||
A module with this name is already loaded.
|
||||
.TP
|
||||
.B EFAULT
|
||||
An address argument referred to an location that
|
||||
An address argument referred to a location that
|
||||
is outside the process's accessible address space.
|
||||
.TP
|
||||
.BR EINVAL " (Linux 2.6 onward)"
|
||||
.B EINVAL
|
||||
.I param_values
|
||||
is invalid, or some part of the ELF image in
|
||||
.IR module_image
|
||||
contains inconsistencies.
|
||||
.TP
|
||||
.BR EINVAL " (Linux 2.4 and earlier)"
|
||||
Some
|
||||
.I image
|
||||
slot is filled in incorrectly,
|
||||
.I image\->name
|
||||
does not correspond to the original module name, some
|
||||
.I image\->deps
|
||||
entry does not correspond to a loaded module,
|
||||
or some other similar inconsistency.
|
||||
.\" .TP
|
||||
.\" .BR EINVAL " (Linux 2.4 and earlier)"
|
||||
.\" Some
|
||||
.\" .I image
|
||||
.\" slot is filled in incorrectly,
|
||||
.\" .I image\->name
|
||||
.\" does not correspond to the original module name, some
|
||||
.\" .I image\->deps
|
||||
.\" entry does not correspond to a loaded module,
|
||||
.\" or some other similar inconsistency.
|
||||
.TP
|
||||
.B ENOEXEC
|
||||
The ELF image in
|
||||
The binary image supplied in
|
||||
.I module_image
|
||||
is too small or has corrupted segments.
|
||||
is not an ELF image,
|
||||
or is an ELF image that is invalid or for a different architecture.
|
||||
.TP
|
||||
.B EPERM
|
||||
The caller was not privileged
|
||||
|
@ -103,6 +107,16 @@ or module loading is disabled
|
|||
.IR /proc/sys/kernel/modules_disabled
|
||||
in
|
||||
.BR proc (5)).
|
||||
.PP
|
||||
In addition to the above errors, if the module's
|
||||
.I init
|
||||
function is executed and returns an error, then
|
||||
.BR init_module ()
|
||||
fails and
|
||||
.I errno
|
||||
is set to the value returned by the
|
||||
.I init
|
||||
function.
|
||||
.SH "CONFORMING TO"
|
||||
.BR init_module ()
|
||||
is Linux-specific.
|
||||
|
@ -126,7 +140,15 @@ In Linux 2.4 and earlier, this system call was rather different:
|
|||
|
||||
.BI " int init_module(const char *" name ", struct module *" image );
|
||||
|
||||
This version of the system call
|
||||
(User-space applications can detect which version of
|
||||
.BR init_module ()
|
||||
is available by calling
|
||||
.BR query_module ();
|
||||
the latter call fails with the error
|
||||
.BR ENOSYS
|
||||
on Linux 2.6 and later.)
|
||||
|
||||
The older version of the system call
|
||||
loads the relocated module image pointed to by
|
||||
.I image
|
||||
into kernel space and runs the module's
|
||||
|
@ -139,7 +161,7 @@ system call does the relocation).
|
|||
.PP
|
||||
The module image begins with a module structure and is followed by
|
||||
code and data as appropriate.
|
||||
The module structure is defined as follows:
|
||||
Since Linux 2.2, the module structure is defined as follows:
|
||||
.PP
|
||||
.in +4n
|
||||
.nf
|
||||
|
@ -177,4 +199,5 @@ the rest of the module.
|
|||
.BR create_module (2),
|
||||
.BR delete_module (2),
|
||||
.BR query_module (2),
|
||||
.BR lsmod (8),
|
||||
.BR modprobe (8)
|
||||
|
|
Loading…
Reference in New Issue