OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man2 / create_module.2
1 .\" Copyright (C) 1996 Free Software Foundation, Inc.
2 .\"
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" This file is distributed according to the GNU General Public License.
5 .\" %%%LICENSE_END
6 .\"
7 .\" 2006-02-09, some reformatting by Luc Van Oostenryck; some
8 .\" reformatting and rewordings by mtk
9 .\"
10 .TH CREATE_MODULE 2 2014-05-10 "Linux" "Linux Programmer's Manual"
11 .SH NAME
12 create_module \- create a loadable module entry
13 .SH SYNOPSIS
14 .nf
15 .B #include <linux/module.h>
16 .sp
17 .BI "caddr_t create_module(const char *" name ", size_t " size );
18 .fi
19
20 .IR Note :
21 No declaration of this function is provided in glibc headers; see NOTES.
22 .SH DESCRIPTION
23 .IR Note :
24 This system call is present only in kernels before Linux 2.6.
25
26 .BR create_module ()
27 attempts to create a loadable module entry and reserve the kernel memory
28 that will be needed to hold the module.
29 This system call requires privilege.
30 .SH RETURN VALUE
31 On success, returns the kernel address at which the module will reside.
32 On error, \-1 is returned and
33 .I errno
34 is set appropriately.
35 .SH ERRORS
36 .TP
37 .B EEXIST
38 A module by that name already exists.
39 .TP
40 .B EFAULT
41 .I name
42 is outside the program's accessible address space.
43 .TP
44 .B EINVAL
45 The requested size is too small even for the module header information.
46 .TP
47 .B ENOMEM
48 The kernel could not allocate a contiguous block of memory large
49 enough for the module.
50 .TP
51 .B ENOSYS
52 .BR create_module ()
53 is not supported in this version of the kernel
54 (e.g., the kernel is version 2.6 or later).
55 .TP
56 .B EPERM
57 The caller was not privileged
58 (did not have the
59 .B CAP_SYS_MODULE
60 capability).
61 .SH VERSIONS
62 This system call is present on Linux only up until kernel 2.4;
63 it was removed in Linux 2.6.
64 .\" Removed in Linux 2.5.48
65 .SH CONFORMING TO
66 .BR create_module ()
67 is Linux-specific.
68 .SH NOTES
69 The
70 .BR create_module ()
71 system call is not supported by glibc.
72 No declaration is provided in glibc headers, but,
73 through a quirk of history, glibc does export an ABI for this system call.
74 Therefore, in order to employ this system call,
75 it is sufficient to manually declare the interface in your code;
76 alternatively, you can invoke the system call using
77 .BR syscall (2).
78 .SH SEE ALSO
79 .BR delete_module (2),
80 .BR init_module (2),
81 .BR query_module (2)
82 .SH COLOPHON
83 This page is part of release 3.79 of the Linux
84 .I man-pages
85 project.
86 A description of the project,
87 information about reporting bugs,
88 and the latest version of this page,
89 can be found at
90 \%http://www.kernel.org/doc/man\-pages/.