OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / init_module.2
1 .\" Copyright (C) 1996 Free Software Foundation, Inc.
2 .\" This file is distributed according to the GNU General Public License.
3 .\" See the file COPYING in the top level source directory for details.
4 .\"
5 .\" 2006-02-09, some reformatting by Luc Van Oostenryck; some
6 .\" reformatting and rewordings by mtk
7 .\"
8 .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved.
9 .\" Translated 2006-07-29, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
10 .\"
11 .TH INIT_MODULE 2 2006-02-09 "Linux" "Linux Programmer's Manual"
12 .\"O .SH NAME
13 .SH Ì¾Á°
14 .\"O init_module \- initialize a loadable module entry
15 init_module \- ¥í¡¼¥À¥Ö¥ë¥â¥¸¥å¡¼¥ë¤Î¥¨¥ó¥È¥ê¤ò½é´ü²½¤¹¤ë
16 .\"O .SH SYNOPSIS
17 .SH ½ñ¼°
18 .nf
19 .B #include <linux/module.h>
20 .sp
21 .BI "int init_module(const char *" name ", struct module *" image );
22 .fi
23 .\"O .SH DESCRIPTION
24 .SH ÀâÌÀ
25 .\"O .BR init_module ()
26 .\"O loads the relocated module image into kernel space and runs the
27 .\"O module's
28 .\"O .I init
29 .\"O function.
30 .BR init_module ()
31 ¤ÏºÆÇÛÃÖ¤µ¤ì¤¿¥â¥¸¥å¡¼¥ë¥¤¥á¡¼¥¸¤ò¥«¡¼¥Í¥ë¶õ´Ö¤Ë¥í¡¼¥É¤·¡¢
32 ¤½¤Î¥â¥¸¥å¡¼¥ë¤Î
33 .I init
34 ´Ø¿ô¤ò¼Â¹Ô¤¹¤ë¡£
35 .PP
36 .\"O The module image begins with a module structure and is followed by
37 .\"O code and data as appropriate.
38 .\"O The module structure is defined as follows:
39 ¥â¥¸¥å¡¼¥ë¥¤¥á¡¼¥¸¤ÏÀèƬÉôʬ¤Ë module ¹½Â¤ÂΤ¬¤¢¤ê¡¢¤½¤Î¸å¤í¤Ë
40 ŬÀڤʥ³¡¼¥É¤È¥Ç¡¼¥¿¤¬Â³¤¯¡£
41 ¤³¤Î module ¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
42 .PP
43 .in +4n
44 .nf
45 struct module {
46     unsigned long         size_of_struct;
47     struct module        *next;
48     const char           *name;
49     unsigned long         size;
50     long                  usecount;
51     unsigned long         flags;
52     unsigned int          nsyms;
53     unsigned int          ndeps;
54     struct module_symbol *syms;
55     struct module_ref    *deps;
56     struct module_ref    *refs;
57     int                 (*init)(void);
58     void                (*cleanup)(void);
59     const struct exception_table_entry *ex_table_start;
60     const struct exception_table_entry *ex_table_end;
61 #ifdef __alpha__
62     unsigned long gp;
63 #endif
64 };
65 .fi
66 .in
67 .PP
68 .\"O All of the pointer fields, with the exception of
69 .\"O .I next
70 .\"O and
71 .\"O .IR refs ,
72 .\"O are expected to point within the module body and be
73 .\"O initialized as appropriate for kernel space, that is, relocated with
74 .\"O the rest of the module.
75 .I next
76 ¤È
77 .I refs
78 °Ê³°¤ÎÁ´¤Æ¤Î¥Ý¥¤¥ó¥¿Í×ÁǤϥ⥸¥å¡¼¥ëËÜÂÎÆâÉô¤ò»Ø¤·¡¢
79 ¥«¡¼¥Í¥ë¶õ´Ö¤Ç¤ÎŬÀÚ¤ÊÃͤǽé´ü²½¤µ¤ì¤ë (¤Ä¤Þ¤ê¡¢¥â¥¸¥å¡¼¥ë¤Î»Ä¤ê¤Î
80 Éôʬ¤ÇºÆÇÛÃÖ¤µ¤ì¤ë) ¤³¤È¤¬´üÂÔ¤µ¤ì¤ë¡£
81 .PP
82 .\"O This system call requires privilege.
83 ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤Ë¤ÏÆø¢¤¬É¬ÍפǤ¢¤ë¡£
84 .\"O .SH "RETURN VALUE"
85 .SH ÊÖ¤êÃÍ
86 .\"O On success, zero is returned.
87 .\"O On error, \-1 is returned and
88 .\"O .I errno
89 .\"O is set appropriately.
90 À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢
91 .I errno
92 ¤òŬÀÚ¤ËÀßÄꤹ¤ë¡£
93 .\"O .SH ERRORS
94 .SH ¥¨¥é¡¼
95 .TP
96 .B EBUSY
97 .\"O The module's initialization routine failed.
98 ¥â¥¸¥å¡¼¥ë¤Î½é´ü²½¥ë¡¼¥Á¥ó¤¬¼ºÇÔ¤·¤¿¡£
99 .TP
100 .B EFAULT
101 .\"O .I name
102 .\"O or
103 .\"O .I image
104 .\"O is outside the program's accessible address space.
105 .I name
106 ¤ä
107 .I image
108 ¤¬¥×¥í¥°¥é¥à¤¬¥¢¥¯¥»¥¹¤Ç¤­¤ë¥¢¥É¥ì¥¹¶õ´Ö¤Î³°Éô¤Ë¤¢¤ë¡£
109 .TP
110 .B EINVAL
111 .\"O Some
112 .\"O .I image
113 .\"O slot is filled in incorrectly,
114 .\"O .I image\->name
115 .\"O does not correspond to the original module name, some
116 .\"O .I image\->deps
117 .\"O entry does not correspond to a loaded module,
118 .\"O or some other similar inconsistency.
119 °ìÉô¤Î
120 .I image
121 ¥¹¥í¥Ã¥È¤Ë¤ª¤«¤·¤ÊÃͤ¬Æþ¤Ã¤Æ¤¤¤ë¡£¤Þ¤¿¤Ï
122 .I image\->name
123 ¤¬¸µ¤Î¥â¥¸¥å¡¼¥ë̾¤È°ìÃפ·¤Æ¤¤¤Ê¤¤¡£¤Þ¤¿¤Ï¡¢°ìÉô¤Î
124 .I image\->deps
125 ¥¨¥ó¥È¥ê¤¬¥í¡¼¥É¤µ¤ì¤¿¥â¥¸¥å¡¼¥ë¤ËÂбþ¤·¤Æ¤¤¤Ê¤¤¡£
126 ¤Þ¤¿¤Ï¡¢Â¾¤ËƱÍͤÎÌ·½â¤¬µ¯¤³¤Ã¤Æ¤¤¤ë¡£
127 .TP
128 .B ENOENT
129 .\"O No module by that name exists.
130 ¤½¤Î̾Á°¤Î¥â¥¸¥å¡¼¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£
131 .TP
132 .B EPERM
133 .\"O The caller was not privileged
134 .\"O (did not have the
135 .\"O .B CAP_SYS_MODULE
136 .\"O capability).
137 ¸Æ¤Ó½Ð¤·¸µ¤¬Æø¢
138 .RB ( CAP_SYS_MODULE
139 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£
140 .\"O .SH "CONFORMING TO"
141 .SH ½àµò
142 .\"O .BR init_module ()
143 .\"O is Linux-specific.
144 .BR init_module ()
145 ¤Ï Linux ¸ÇÍ­¤Ç¤¢¤ë¡£
146 .\"O .SH "SEE ALSO"
147 .SH ´ØÏ¢¹àÌÜ
148 .BR create_module (2),
149 .BR delete_module (2),
150 .BR query_module (2)