OSDN Git Service

modutils: add notices telling that this package is obsolete.
[linuxjm/jm.git] / manual / modutils / release / man2 / init_module.2
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.
4 .\"
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>
11 .\"
12 .\"WORD:        loadable module         ローダブルモジュール
13 .\"
14 .TH INIT_MODULE 2 "26 Dec 1996" "Linux 2.1.17" "Linux Module Support"
15 .SH 名前
16 init_module \- ローダブルモジュールのエントリを初期化する
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 .SH このマニュアルについて
24 これは、Linux Kernel 2.4 の時代に使われていた modutils
25 パッケージ所収の古いマニュアルです。(2022/12/02, Linux JM Project)
26 .SH 説明
27 .B init_module
28 は再配置されたモジュールイメージをカーネル空間にロードし、その
29 モジュールの \fIinit\fP 関数を実行する。
30 .PP
31 モジュールイメージは、先頭部分にモジュール構造体が置かれ、その後に適切
32 なコードとデータが配置される。モジュール構造体の定義を以下に示す:
33 .PP
34 .RS
35 .nf
36 struct module
37 {
38   unsigned long size_of_struct;
39   struct module *next;
40   const char *name;
41   unsigned long size;
42   long usecount;
43   unsigned long flags;
44   unsigned int nsyms;
45   unsigned int ndeps;
46   struct module_symbol *syms;
47   struct module_ref *deps;
48   struct module_ref *refs;
49   int (*init)(void);
50   void (*cleanup)(void);
51   const struct exception_table_entry *ex_table_start;
52   const struct exception_table_entry *ex_table_end;
53 #ifdef __alpha__
54   unsigned long gp;
55 #endif
56 };
57 .fi
58 .RE
59 .PP
60 \fInext\fP と \fIrefs\fP 以外の全てのポインタ要素は、
61 モジュールの本体内部を指し、カーネル空間での適切な値で初期化される
62 (つまりモジュールの残りの部分と共に再配置される)ことが期待される。
63 .PP
64 このシステムコールを使えるのはユーパーユーザだけである。
65 .SH 返り値
66 成功した場合は 0 が返される。エラーの場合は \-1 が返され、\fIerrno\fP 
67 に適切な値が設定される。
68 .SH エラー
69 .TP
70 .B EPERM
71 呼び出しを行ったユーザがスーパーユーザでない。
72 .TP
73 .B ENOENT
74 その名前を持つモジュールが存在しない。
75 .TP
76 .B EINVAL
77 \fIimage\fP スロットの一部に誤った値が入っているか、
78 \fIimage->name\fP が元のモジュールの名前に一致していないか、
79 \fIimage->deps\fP エントリの一部がロードされたモジュールに対応していない。
80 あるいは同様の別の矛盾が起きている。
81 .TP
82 .B EBUSY
83 モジュールの初期化ルーチンが失敗した。
84 .TP
85 .B EFAULT
86 \fIname\fP あるいは \fIimage\fP が、プログラムがアクセスできる
87 アドレス空間の外部である。
88 .SH 関連項目
89 .BR create_module "(2), " delete_module "(2), " query_module "(2)"
90