.\" 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 .\" .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. .\" Translated 2006-07-29, Akihiro MOTOKI .\" .TH INIT_MODULE 2 2006-02-09 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O init_module \- initialize a loadable module entry init_module \- ローダブルモジュールのエントリを初期化する .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "int init_module(const char *" name ", struct module *" image ); .fi .\"O .SH DESCRIPTION .SH 説明 .\"O .BR init_module () .\"O loads the relocated module image into kernel space and runs the .\"O module's .\"O .I init .\"O function. .BR init_module () は再配置されたモジュールイメージをカーネル空間にロードし、 そのモジュールの .I init 関数を実行する。 .PP .\"O The module image begins with a module structure and is followed by .\"O code and data as appropriate. .\"O The module structure is defined as follows: モジュールイメージは先頭部分に 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 .\"O All of the pointer fields, with the exception of .\"O .I next .\"O and .\"O .IR refs , .\"O are expected to point within the module body and be .\"O initialized as appropriate for kernel space, that is, relocated with .\"O the rest of the module. .I next と .I refs 以外の全てのポインタ要素はモジュール本体内部を指し、 カーネル空間での適切な値で初期化される (つまり、モジュールの残りの 部分で再配置される) ことが期待される。 .PP .\"O This system call requires privilege. このシステムコールを使うには特権が必要である。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O On success, zero is returned. .\"O On error, \-1 is returned and .\"O .I errno .\"O is set appropriately. 成功すると 0 を返す。エラーの場合 \-1 を返し、 .I errno を適切に設定する。 .\"O .SH ERRORS .SH エラー .TP .B EBUSY .\"O The module's initialization routine failed. モジュールの初期化ルーチンが失敗した。 .TP .B EFAULT .\"O .I name .\"O or .\"O .I image .\"O is outside the program's accessible address space. .I name や .I image がプログラムがアクセスできるアドレス空間の外部にある。 .TP .B EINVAL .\"O Some .\"O .I image .\"O slot is filled in incorrectly, .\"O .I image\->name .\"O does not correspond to the original module name, some .\"O .I image\->deps .\"O entry does not correspond to a loaded module, .\"O or some other similar inconsistency. 一部の .I image スロットにおかしな値が入っている。または .I image\->name が元のモジュール名と一致していない。または、一部の .I image\->deps エントリがロードされたモジュールに対応していない。 または、他に同様の矛盾が起こっている。 .TP .B ENOENT .\"O No module by that name exists. その名前のモジュールが存在しない。 .TP .B EPERM .\"O The caller was not privileged .\"O (did not have the .\"O .B CAP_SYS_MODULE .\"O capability). 呼び出し元が特権 .RB ( CAP_SYS_MODULE ケーパビリティ) を持っていなかった。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O .BR init_module () .\"O is Linux-specific. .BR init_module () は Linux 固有である。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR create_module (2), .BR delete_module (2), .BR query_module (2)