Provided by: manpages-zh_1.6.3.6-1_all
NAME
init_module - 初始化一條可載入模組的記錄.
總覽
#include <linux/module.h> int init_module(const char *name, struct module *image);
描述
init_module載入已被重定位的模組映象到核心空間,並執行模組的初始化函式. 模組映象以module結 構開始,緊跟著程式碼和資料,module定義如下: struct module { unsigned long size_of_struct; /* module結構的大小 */ struct module *next; /*指向下一個module結構 */ 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被相應設定.
錯誤
EPERM 使用者不是超級使用者. ENOENT name指定的模組不存在. EINVAL EBUSY 模組的初始化函式失敗. EFAULT name或image越出了程式可訪問的地址空間. "雷勇" <nsinit@263.net>
跋
本頁面中文版由中文 man 手冊頁計劃提供。 中文 man 手冊頁計劃:https://github.com/man-pages-zh/manpages-zh init_module()