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中刪除。