OSDN Git Service

(split) LDP: draft snapshot generated from latest ja.po files.
[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 .\"*******************************************************************
9 .\"
10 .\" This file was generated with po4a. Translate the source file.
11 .\"
12 .\"*******************************************************************
13 .TH INIT_MODULE 2 2006\-02\-09 Linux "Linux Programmer's Manual"
14 .SH 名前
15 init_module \- ローダブルモジュールのエントリを初期化する
16 .SH 書式
17 .nf
18 \fB#include <linux/module.h>\fP
19 .sp
20 \fBint init_module(const char *\fP\fIname\fP\fB, struct module *\fP\fIimage\fP\fB);\fP
21 .fi
22 .SH 説明
23 \fBinit_module\fP()  は再配置されたモジュールイメージをカーネル空間にロードし、 そのモジュールの \fIinit\fP 関数を実行する。
24 .PP
25 モジュールイメージは先頭部分に module 構造体があり、その後ろに 適切なコードとデータが続く。 この module
26 構造体は以下のように定義されている:
27 .PP
28 .in +4n
29 .nf
30 struct module {
31     unsigned long         size_of_struct;
32     struct module        *next;
33     const char           *name;
34     unsigned long         size;
35     long                  usecount;
36     unsigned long         flags;
37     unsigned int          nsyms;
38     unsigned int          ndeps;
39     struct module_symbol *syms;
40     struct module_ref    *deps;
41     struct module_ref    *refs;
42     int                 (*init)(void);
43     void                (*cleanup)(void);
44     const struct exception_table_entry *ex_table_start;
45     const struct exception_table_entry *ex_table_end;
46 #ifdef __alpha__
47     unsigned long gp;
48 #endif
49 };
50 .fi
51 .in
52 .PP
53 \fInext\fP と \fIrefs\fP 以外の全てのポインタ要素はモジュール本体内部を指し、 カーネル空間での適切な値で初期化される
54 (つまり、モジュールの残りの 部分で再配置される) ことが期待される。
55 .PP
56 このシステムコールを使うには特権が必要である。
57 .SH 返り値
58 成功の場合 0 が返される。エラーの場合 \-1 が返され、 \fIerrno\fP に適切な値が設定される。
59 .SH エラー
60 .TP 
61 \fBEBUSY\fP
62 モジュールの初期化ルーチンが失敗した。
63 .TP 
64 \fBEFAULT\fP
65 \fIname\fP や \fIimage\fP がプログラムがアクセスできるアドレス空間の外部にある。
66 .TP 
67 \fBEINVAL\fP
68 一部の \fIimage\fP スロットにおかしな値が入っている。または \fIimage\->name\fP
69 が元のモジュール名と一致していない。または、一部の \fIimage\->deps\fP エントリがロードされたモジュールに対応していない。
70 または、他に同様の矛盾が起こっている。
71 .TP 
72 \fBENOENT\fP
73 その名前のモジュールが存在しない。
74 .TP 
75 \fBEPERM\fP
76 呼び出し元が特権 (\fBCAP_SYS_MODULE\fP ケーパビリティ) を持っていなかった。
77 .SH 準拠
78 \fBinit_module\fP()  は Linux 固有である。
79 .SH 関連項目
80 \fBcreate_module\fP(2), \fBdelete_module\fP(2), \fBquery_module\fP(2)