create_module 中文man頁(yè)面
NAME
create_module - 生成一條可加載模塊記錄.
總覽
#include <linux/module.h>
caddr_t create_module(const char *name, size_t size);
描述
create_module試圖生成一條可加載模塊的記錄并保留用來(lái)容納模塊的內(nèi)核空間內(nèi)存.該系統(tǒng)調(diào)用只對(duì)超級(jí)用戶(hù)開(kāi)放.
返回值
成功時(shí)返回模塊駐留的內(nèi)核空間地址,錯(cuò)誤時(shí)返回-1,errno被相應(yīng)設(shè)置.
錯(cuò)誤
- EPERM
用戶(hù)非超級(jí)用戶(hù).- EEXIST
相同名字的模塊已經(jīng)存在.- EINVAL
要求的大小即使對(duì)模塊的頭信息來(lái)說(shuō)也太小.- ENOMEM
內(nèi)核無(wú)法給模塊分配足夠的連續(xù)的內(nèi)存塊.- EFAULT
name 越出了程序可訪問(wèn)的地址空間.
#p#
NAME
create_module - create a loadable module entry
SYNOPSIS
#include <linux/module.h> caddr_t create_module(const char *name, size_t size);
DESCRIPTION
create_module attempts to create a loadable module entry and reserve the kernel memory that will be needed to hold the module. This system call is only open to the superuser.
RETURN VALUE
On success, returns the kernel address at which the module will reside. On error -1 is returned and errno is set appropriately.
ERRORS
- EPERM
- The user is not the superuser.
- EEXIST
- A module by that name already exists.
- 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.
- EFAULT
- name is outside the program's accessible address space.
SEE ALSO
init_module(2), delete_module(2), query_module(2).