create_module()函式 Unix/Linux


create_module - 建立一個可載入模組專案

內容簡介


				

#include <linux/module.h> caddr_t create_module(const char *name, size_t size);

描述

create_module() 嘗試建立一個可載入模組專案,並預定將需要按住模組的核心記憶體。此系統呼叫需要的特權。

返回值

On success, returns the kernel address at which the module will reside. On error -1 is returned and errno is set appropriately.

錯誤

Error Code 描述
EEXIST A module by that name already exists.
EFAULT name is outside the program’s accessible address space.
EINVAL The requested size is too small even for the module header information.
ENOMEM The kernel could not allocate a contiguous block of memory large enough for the module.
EPERM The caller was not privileged (did not have theCAP_SYS_MODULE capability).

遵循於

create_module() is Linux specific.

注意

這個系統呼叫是目前唯一在Linux2.4核心,直到它在Linux2.6中刪除。

另請參閱