man-pages/man2/create_module.2.html
2021-03-31 01:06:50 +01:00

154 lines
3.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of CREATE_MODULE</TITLE>
</HEAD><BODY>
<H1>CREATE_MODULE</H1>
Section: Linux Programmer's Manual (2)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
create_module - create a loadable module entry
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
<B>#include &lt;<A HREF="file:///usr/include/linux/module.h">linux/module.h</A>&gt;</B>
<B>caddr_t create_module(const char *</B><I>name</I><B>, size_t </B><I>size</I><B>);</B>
</PRE>
<P>
<I>Note</I>:
No declaration of this system call is provided in glibc headers; see NOTES.
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<I>Note</I>:
This system call is present only in kernels before Linux 2.6.
<P>
<B>create_module</B>()
attempts to create a loadable module entry and reserve the kernel memory
that will be needed to hold the module.
This system call requires privilege.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
On success, returns the kernel address at which the module will reside.
On error, -1 is returned and
<I>errno</I>
is set appropriately.
<A NAME="lbAF">&nbsp;</A>
<H2>ERRORS</H2>
<DL COMPACT>
<DT id="1"><B>EEXIST</B>
<DD>
A module by that name already exists.
<DT id="2"><B>EFAULT</B>
<DD>
<I>name</I>
is outside the program's accessible address space.
<DT id="3"><B>EINVAL</B>
<DD>
The requested size is too small even for the module header information.
<DT id="4"><B>ENOMEM</B>
<DD>
The kernel could not allocate a contiguous block of memory large
enough for the module.
<DT id="5"><B>ENOSYS</B>
<DD>
<B>create_module</B>()
is not supported in this version of the kernel
(e.g., the kernel is version 2.6 or later).
<DT id="6"><B>EPERM</B>
<DD>
The caller was not privileged
(did not have the
<B>CAP_SYS_MODULE</B>
capability).
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>VERSIONS</H2>
This system call is present on Linux only up until kernel 2.4;
it was removed in Linux 2.6.
<A NAME="lbAH">&nbsp;</A>
<H2>CONFORMING TO</H2>
<B>create_module</B>()
is Linux-specific.
<A NAME="lbAI">&nbsp;</A>
<H2>NOTES</H2>
This obsolete system call is not supported by glibc.
No declaration is provided in glibc headers, but, through a quirk of history,
glibc versions before 2.23 did export an ABI for this system call.
Therefore, in order to employ this system call,
it was sufficient to manually declare the interface in your code;
alternatively, you could invoke the system call using
<B><A HREF="/cgi-bin/man/man2html?2+syscall">syscall</A></B>(2).
<A NAME="lbAJ">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?2+delete_module">delete_module</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+init_module">init_module</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+query_module">query_module</A></B>(2)
<A NAME="lbAK">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 of the Linux
<I>man-pages</I>
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="7"><A HREF="#lbAB">NAME</A><DD>
<DT id="8"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="9"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="10"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DT id="11"><A HREF="#lbAF">ERRORS</A><DD>
<DT id="12"><A HREF="#lbAG">VERSIONS</A><DD>
<DT id="13"><A HREF="#lbAH">CONFORMING TO</A><DD>
<DT id="14"><A HREF="#lbAI">NOTES</A><DD>
<DT id="15"><A HREF="#lbAJ">SEE ALSO</A><DD>
<DT id="16"><A HREF="#lbAK">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:32 GMT, March 31, 2021
</BODY>
</HTML>