|
HOME > Linux Tips ( 目次 ) > Linux コマンド 一覧表 > i > init_module - システムコールの説明 init_module - システムコールの説明 - Linux コマンド集 一覧表名前init_module - ローダブルモジュールのエントリを初期化する 書式
#include <linux/module.h> 説明init_module ()は再配置されたモジュールイメージをカーネル空間にロードし、 そのモジュールの init 関数を実行する。 モジュールイメージは先頭部分に module 構造体があり、その後ろに 適切なコードとデータが続く。 この module 構造体は以下のように定義されている: 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
};
next と refs 以外の全てのポインタ要素はモジュール本体内部を指し、 カーネル空間での適切な値で初期化される (つまり、モジュールの残りの 部分で再配置される) ことが期待される。 このシステムコールを使うには特権が必要である。 返り値成功すると 0 を返す。エラーの場合 -1 を返し、 errno を適切に設定する。 エラー
準拠init_module ()は Linux 固有である。 関連項目
|
|