1 .\" Copyright (C) 1996 Free Software Foundation, Inc.
2 .\" This file is distributed accroding to the GNU General Public License.
3 .\" See the file COPYING in the top level source directory for details.
5 .\" Japanese Version Copyright (c) 1997,1999 HANATAKA Shinya and FUJIWARA Teruyoshi
6 .\" all rights reserved.
7 .\" Translated Sat Aug 30 13:53:25 JST 1997
8 .\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
9 .\" Merged with another translation Sun Aug 15 10:39:49 JST 1999
10 .\" by FUJIWARA Teruyoshi <fujiwara@linux.or.jp>
12 .\"WORD: loadable module ローダブルモジュール
14 .TH INIT_MODULE 2 "26 Dec 1996" "Linux 2.1.17" "Linux Module Support"
16 init_module \- ローダブルモジュールのエントリを初期化する
19 .B #include <linux/module.h>
21 .BI "int init_module(const char *" name ", struct module *" image );
25 は再配置されたモジュールイメージをカーネル空間にロードし、その
26 モジュールの \fIinit\fP 関数を実行する。
28 モジュールイメージは、先頭部分にモジュール構造体が置かれ、その後に適切
29 なコードとデータが配置される。モジュール構造体の定義を以下に示す:
35 unsigned long size_of_struct;
43 struct module_symbol *syms;
44 struct module_ref *deps;
45 struct module_ref *refs;
47 void (*cleanup)(void);
48 const struct exception_table_entry *ex_table_start;
49 const struct exception_table_entry *ex_table_end;
57 \fInext\fP と \fIrefs\fP 以外の全てのポインタ要素は、
58 モジュールの本体内部を指し、カーネル空間での適切な値で初期化される
59 (つまりモジュールの残りの部分と共に再配置される)ことが期待される。
61 このシステムコールを使えるのはユーパーユーザだけである。
63 成功した場合は 0 が返される。エラーの場合は \-1 が返され、\fIerrno\fP
68 呼び出しを行ったユーザがスーパーユーザでない。
74 \fIimage\fP スロットの一部に誤った値が入っているか、
75 \fIimage->name\fP が元のモジュールの名前に一致していないか、
76 \fIimage->deps\fP エントリの一部がロードされたモジュールに対応していない。
83 \fIname\fP あるいは \fIimage\fP が、プログラムがアクセスできる
86 .BR create_module "(2), " delete_module "(2), " query_module "(2)"