arch_prctl(2) System Calls Manual arch_prctl(2) arch_prctl - ( ) C (libc, -lc) #include /* ARCH_* */ #include /* SYS_* */ #include int syscall(SYS_arch_prctl, int op, unsigned long addr); int syscall(SYS_arch_prctl, int op, unsigned long *addr); : glibc arch_prctl(), syscall(2). arch_prctl() sets architecture-specific process or thread state. op selects an operation and passes argument addr to it; addr is interpreted as either an unsigned long for the "set" operations, or as an unsigned long *, for the "get" operations. x86 x86-64: ARCH_SET_CPUID ( Linux 4.12) Enable (addr != 0) or disable (addr == 0) the cpuid instruction for the calling thread. The instruction is enabled by default. If disabled, any execution of a cpuid instruction will instead generate a SIGSEGV signal. This feature can be used to emulate cpuid results that differ from what the underlying hardware would have produced (e.g., in a paravirtualization setting). The ARCH_SET_CPUID setting is preserved across fork(2) and clone(2) but reset to the default (i.e., cpuid enabled) on execve(2). ARCH_GET_CPUID ( Linux 4.12) Return the setting of the flag manipulated by ARCH_SET_CPUID as the result of the system call (1 for enabled, 0 for disabled). addr is ignored. x86-64: ARCH_SET_FS 64- FS addr. ARCH_GET_FS Return the 64-bit base value for the FS register of the calling thread in the unsigned long pointed to by addr. ARCH_SET_GS 64- GS addr. ARCH_GET_GS Return the 64-bit base value for the GS register of the calling thread in the unsigned long pointed to by addr. arch_prctl() 0; -- -1, errno . EFAULT addr . EINVAL op - . ENODEV ARCH_SET_CPUID , CPUID. EPERM addr . Linux/x86-64. arch_prctl() Linux/x86-64 64- . 64- 32- . ARCH_SET_GS . 64- -- . , 3- TLS, arch_prctl() TLS, set_thread_area(2), . 2 mmap(2) MAP_32BIT. - , arch_prctl() set_thread_area(2) , TLS- . FS . , ARCH_SET_FS , . mmap(2), modify_ldt(2), prctl(2), set_thread_area(2) AMD X86-64 () Dmitry Bolkhovskikh Yuri Kozlov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () . Linux man-pages 6.18 8 2026 . arch_prctl(2)