arch_prctl()函数 Unix/Linux
名称
arch_prctl - 设置架构特定的线程状态
内容简介
#include <asm/prctl.h> #include <sys/prctl.h> int arch_prctl(int code, unsigned long addr) |
描述
arch_prctl() 函数设置架构的具体进程或线程状态。代码选择一个子功能和参数地址传递给它。
x86-64的子函数是:
标签 | 描述 |
---|---|
ARCH_SET_FS | Set the 64bit base for the FS register toaddr. |
ARCH_GET_FS | Return the 64bit base value for theFS register of the current thread in theunsigned long pointed to by the address parameter |
ARCH_SET_GS | Set the 64bit base for the GS register to addr. |
ARCH_GET_GS | Return the 64bit base value for the GS register of the current thread in the unsigned long pointed to by the addressparameter. |
错误
标签 | 描述 |
---|---|
EFAULT | addr points to an unmapped address or is outside the process address space. |
EINVAL | code is not a valid subcommand. |
EPERM | addr is outside the process address space. |
作者
Man page written by Andi Kleen.
遵循于
arch_prctl() 是一个Linux/x86-64的扩展,并且不应该被用在程序准备移植。