内容简介
#include <sys/types.h> int modify_ldt(int func, void *ptr, unsigned long bytecount) |
描述
modify_ldt()%uA0读取或一个进程写入本地描述符表(ldt)。 ldt%uA0是使用i386处理器每个进程的内存管理表。对于该表的详细信息,请参阅英特尔386处理器手册。When%uA0func%uA0is 0,%uA0modify_ldt() reads the ldt into the memory pointed to by%uA0ptr. The number of bytes read is the smaller of%uA0bytecount%uA0and the actual size of the ldt.
When%uA0func%uA0is 1,%uA0modify_ldt() modifies one ldt entry.%uA0ptr%uA0points to a%uA0modify_ldt_ldt_sstructure and%uA0bytecount%uA0must equal the size of this structure.
返回值
On success,%uA0modify_ldt() returns either the actual number of bytes read (for reading) or 0 (for writing). On failure,%uA0modify_ldt() returns -1 and sets%uA0errno.错误
标签 | 描述 |
---|---|
EFAULT | ptr%uA0points outside the address space. |
EINVAL | ptr%uA0is 0, or%uA0func%uA0is 1 and%uA0bytecount%uA0is not equal to the size of the structure%uA0modify_ldt_ldt_s, or%uA0func%uA0is 1 and the new ldt entry has invalid values. |
ENOSYS | func%uA0is neither 0 nor 1. |