.\" Copyright (C) 1996 Free Software Foundation, Inc. .\" This file is distributed according to the GNU General Public License. .\" See the file COPYING in the top level source directory for details. .\" .\" 2006-02-09, some reformatting by Luc Van Oostenryck; some .\" reformatting and rewordings by mtk .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH INIT_MODULE 2 2006\-02\-09 Linux "Linux Programmer's Manual" .SH 名前 init_module \- ローダブルモジュールのエントリを初期化する .SH 書式 .nf \fB#include \fP .sp \fBint init_module(const char *\fP\fIname\fP\fB, struct module *\fP\fIimage\fP\fB);\fP .fi .SH 説明 \fBinit_module\fP() は再配置されたモジュールイメージをカーネル空間にロードし、 そのモジュールの \fIinit\fP 関数を実行する。 .PP モジュールイメージは先頭部分に module 構造体があり、その後ろに 適切なコードとデータが続く。 この module 構造体は以下のように定義されている: .PP .in +4n .nf struct module { unsigned long size_of_struct; struct module *next; const char *name; unsigned long size; long usecount; unsigned long flags; unsigned int nsyms; unsigned int ndeps; struct module_symbol *syms; struct module_ref *deps; struct module_ref *refs; int (*init)(void); void (*cleanup)(void); const struct exception_table_entry *ex_table_start; const struct exception_table_entry *ex_table_end; #ifdef __alpha__ unsigned long gp; #endif }; .fi .in .PP \fInext\fP と \fIrefs\fP 以外の全てのポインタ要素はモジュール本体内部を指し、 カーネル空間での適切な値で初期化される (つまり、モジュールの残りの 部分で再配置される) ことが期待される。 .PP このシステムコールを使うには特権が必要である。 .SH 返り値 成功の場合 0 が返される。エラーの場合 \-1 が返され、 \fIerrno\fP に適切な値が設定される。 .SH エラー .TP \fBEBUSY\fP モジュールの初期化ルーチンが失敗した。 .TP \fBEFAULT\fP \fIname\fP や \fIimage\fP がプログラムがアクセスできるアドレス空間の外部にある。 .TP \fBEINVAL\fP 一部の \fIimage\fP スロットにおかしな値が入っている。または \fIimage\->name\fP が元のモジュール名と一致していない。または、一部の \fIimage\->deps\fP エントリがロードされたモジュールに対応していない。 または、他に同様の矛盾が起こっている。 .TP \fBENOENT\fP その名前のモジュールが存在しない。 .TP \fBEPERM\fP 呼び出し元が特権 (\fBCAP_SYS_MODULE\fP ケーパビリティ) を持っていなかった。 .SH 準拠 \fBinit_module\fP() は Linux 固有である。 .SH 関連項目 \fBcreate_module\fP(2), \fBdelete_module\fP(2), \fBquery_module\fP(2) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.41 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。