OSDN Git Service

12e782a7eca78a7d68469b9d8b522e9d7505b923
[linuxjm/LDP_man-pages.git] / 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)