OSDN Git Service

d7c7ef37daa3c6ff0d9d6c61bc66cf6380b2fea0
[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 2012-10-18 "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 .SH DESCRIPTION
20 .BR Note :
21 This system call is present only in kernels before Linux 2.6.
22
23 .BR create_module ()
24 attempts to create a loadable module entry and reserve the kernel memory
25 that will be needed to hold the module.
26 This system call requires privilege.
27 .SH RETURN VALUE
28 On success, returns the kernel address at which the module will reside.
29 On error, \-1 is returned and
30 .I errno
31 is set appropriately.
32 .SH ERRORS
33 .TP
34 .B EEXIST
35 A module by that name already exists.
36 .TP
37 .B EFAULT
38 .I name
39 is outside the program's accessible address space.
40 .TP
41 .B EINVAL
42 The requested size is too small even for the module header information.
43 .TP
44 .B ENOMEM
45 The kernel could not allocate a contiguous block of memory large
46 enough for the module.
47 .TP
48 .B ENOSYS
49 .BR create_module ()
50 is not supported in this version of the kernel
51 (e.g., the kernel is version 2.6 or later).
52 .TP
53 .B EPERM
54 The caller was not privileged
55 (did not have the
56 .B CAP_SYS_MODULE
57 capability).
58 .SH VERSIONS
59 This system call is present on Linux only up until kernel 2.4;
60 it was removed in Linux 2.6.
61 .\" Removed in Linux 2.5.48
62 .SH CONFORMING TO
63 .BR create_module ()
64 is Linux-specific.
65 .SH SEE ALSO
66 .BR delete_module (2),
67 .BR init_module (2),
68 .BR query_module (2)
69 .SH COLOPHON
70 This page is part of release 3.64 of the Linux
71 .I man-pages
72 project.
73 A description of the project,
74 and information about reporting bugs,
75 can be found at
76 \%http://www.kernel.org/doc/man\-pages/.