NAME
create_module - 生成一条可加载模块记录.
总览
#include <linux/module.h>
caddr_t create_module(const char *name, size_t size);
描述
create_module试图生成一条可加载模块的记录并保留用来容纳模块的内核空间内存.该系统调用只对超级用户开放.
返回值
成功时返回模块驻留的内核空间地址,错误时返回-1,errno被相应设置.
错误
- EPERM
用户非超级用户.- EEXIST
相同名字的模块已经存在.- EINVAL
要求的大小即使对模块的头信息来说也太小.- ENOMEM
内核无法给模块分配足够的连续的内存块.- EFAULT
name 越出了程序可访问的地址空间.
#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).