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.
5 .\" 2006-02-09, some reformatting by Luc Van Oostenryck; some
6 .\" reformatting and rewordings by mtk
8 .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved.
9 .\" Translated 2006-07-29, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
11 .TH INIT_MODULE 2 2006-02-09 "Linux" "Linux Programmer's Manual"
14 .\"O init_module \- initialize a loadable module entry
15 init_module \- ¥í¡¼¥À¥Ö¥ë¥â¥¸¥å¡¼¥ë¤Î¥¨¥ó¥È¥ê¤ò½é´ü²½¤¹¤ë
19 .B #include <linux/module.h>
21 .BI "int init_module(const char *" name ", struct module *" image );
25 .\"O .BR init_module ()
26 .\"O loads the relocated module image into kernel space and runs the
31 ¤ÏºÆÇÛÃÖ¤µ¤ì¤¿¥â¥¸¥å¡¼¥ë¥¤¥á¡¼¥¸¤ò¥«¡¼¥Í¥ë¶õ´Ö¤Ë¥í¡¼¥É¤·¡¢
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 ¹½Â¤ÂΤϰʲ¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
46 unsigned long size_of_struct;
54 struct module_symbol *syms;
55 struct module_ref *deps;
56 struct module_ref *refs;
58 void (*cleanup)(void);
59 const struct exception_table_entry *ex_table_start;
60 const struct exception_table_entry *ex_table_end;
68 .\"O All of the pointer fields, with the exception of
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.
78 °Ê³°¤ÎÁ´¤Æ¤Î¥Ý¥¤¥ó¥¿Í×ÁǤϥ⥸¥å¡¼¥ëËÜÂÎÆâÉô¤ò»Ø¤·¡¢
79 ¥«¡¼¥Í¥ë¶õ´Ö¤Ç¤ÎŬÀÚ¤ÊÃͤǽé´ü²½¤µ¤ì¤ë (¤Ä¤Þ¤ê¡¢¥â¥¸¥å¡¼¥ë¤Î»Ä¤ê¤Î
80 Éôʬ¤ÇºÆÇÛÃÖ¤µ¤ì¤ë) ¤³¤È¤¬´üÂÔ¤µ¤ì¤ë¡£
82 .\"O This system call requires privilege.
83 ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤¦¤Ë¤ÏÆø¢¤¬É¬ÍפǤ¢¤ë¡£
84 .\"O .SH "RETURN VALUE"
86 .\"O On success, zero is returned.
87 .\"O On error, \-1 is returned and
89 .\"O is set appropriately.
90 À®¸ù¤¹¤ë¤È 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç \-1 ¤òÊÖ¤·¡¢
97 .\"O The module's initialization routine failed.
98 ¥â¥¸¥å¡¼¥ë¤Î½é´ü²½¥ë¡¼¥Á¥ó¤¬¼ºÇÔ¤·¤¿¡£
104 .\"O is outside the program's accessible address space.
108 ¤¬¥×¥í¥°¥é¥à¤¬¥¢¥¯¥»¥¹¤Ç¤¤ë¥¢¥É¥ì¥¹¶õ´Ö¤Î³°Éô¤Ë¤¢¤ë¡£
113 .\"O slot is filled in incorrectly,
115 .\"O does not correspond to the original module name, some
117 .\"O entry does not correspond to a loaded module,
118 .\"O or some other similar inconsistency.
121 ¥¹¥í¥Ã¥È¤Ë¤ª¤«¤·¤ÊÃͤ¬Æþ¤Ã¤Æ¤¤¤ë¡£¤Þ¤¿¤Ï
123 ¤¬¸µ¤Î¥â¥¸¥å¡¼¥ë̾¤È°ìÃפ·¤Æ¤¤¤Ê¤¤¡£¤Þ¤¿¤Ï¡¢°ìÉô¤Î
125 ¥¨¥ó¥È¥ê¤¬¥í¡¼¥É¤µ¤ì¤¿¥â¥¸¥å¡¼¥ë¤ËÂбþ¤·¤Æ¤¤¤Ê¤¤¡£
126 ¤Þ¤¿¤Ï¡¢Â¾¤ËƱÍͤÎÌ·½â¤¬µ¯¤³¤Ã¤Æ¤¤¤ë¡£
129 .\"O No module by that name exists.
130 ¤½¤Î̾Á°¤Î¥â¥¸¥å¡¼¥ë¤¬Â¸ºß¤·¤Ê¤¤¡£
133 .\"O The caller was not privileged
134 .\"O (did not have the
135 .\"O .B CAP_SYS_MODULE
139 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£) ¤ò»ý¤Ã¤Æ¤¤¤Ê¤«¤Ã¤¿¡£
140 .\"O .SH "CONFORMING TO"
142 .\"O .BR init_module ()
143 .\"O is Linux-specific.
145 ¤Ï Linux ¸ÇͤǤ¢¤ë¡£
148 .BR create_module (2),
149 .BR delete_module (2),