.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
-.TH DELETE_MODULE 2 2016-03-15 "Linux" "Linux Programmer's Manual"
+.TH DELETE_MODULE 2 2017-09-15 "Linux" "Linux Programmer's Manual"
.SH NAME
delete_module \- unload a kernel module
.SH SYNOPSIS
.nf
.BI "int delete_module(const char *" name ", int " flags );
.fi
-
+.PP
.IR Note :
No declaration of this system call is provided in glibc headers; see NOTES.
.SH DESCRIPTION
argument is used to modify the behavior of the system call,
as described below.
This system call requires privilege.
-
+.PP
Module removal is attempted according to the following rules:
.IP 1. 4
If there are other loaded modules that depend on
flag may additionally be specified.
.\" O_TRUNC == KMOD_REMOVE_FORCE in kmod library
.\" O_NONBLOCK == KMOD_REMOVE_NOWAIT in kmod library
-
+.IP
The various combinations for
.I flags
have the following effect:
.I init
function but no
.I exit
-function, then an attempt to remove the module will fail.
+function, then an attempt to remove the module fails.
However, if
.BR O_TRUNC
was specified, this requirement is bypassed.
manually declare the interface in your code;
alternatively, you can invoke the system call using
.BR syscall (2).
-
+.PP
The uninterruptible sleep that may occur if
.BR O_NONBLOCK
is omitted from
is optional, but in future kernels it is likely to become mandatory.
.SS Linux 2.4 and earlier
In Linux 2.4 and earlier, the system call took only one argument:
-
+.PP
.BI " int delete_module(const char *" name );
-
+.PP
If
.I name
is NULL, all unused modules marked auto-clean are removed.
-
+.PP
Some further details of differences in the behavior of
.BR delete_module ()
in Linux 2.4 and earlier are