diff options
Diffstat (limited to 'man2/arch_prctl.2')
-rw-r--r-- | man2/arch_prctl.2 | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/man2/arch_prctl.2 b/man2/arch_prctl.2 index 04a3633..6981ec3 100644 --- a/man2/arch_prctl.2 +++ b/man2/arch_prctl.2 @@ -2,7 +2,7 @@ .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" -.TH arch_prctl 2 2023-03-30 "Linux man-pages 6.05.01" +.TH arch_prctl 2 2024-03-03 "Linux man-pages 6.7" .SH NAME arch_prctl \- set architecture-specific thread state .SH LIBRARY @@ -13,11 +13,11 @@ Standard C library .BR "#include <asm/prctl.h>" " /* Definition of " ARCH_* " constants */" .BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */" .B #include <unistd.h> -.PP -.BI "int syscall(SYS_arch_prctl, int " code ", unsigned long " addr ); -.BI "int syscall(SYS_arch_prctl, int " code ", unsigned long *" addr ); +.P +.BI "int syscall(SYS_arch_prctl, int " op ", unsigned long " addr ); +.BI "int syscall(SYS_arch_prctl, int " op ", unsigned long *" addr ); .fi -.PP +.P .IR Note : glibc provides no wrapper for .BR arch_prctl (), @@ -26,8 +26,8 @@ necessitating the use of .SH DESCRIPTION .BR arch_prctl () sets architecture-specific process or thread state. -.I code -selects a subfunction +.I op +selects an operation and passes argument .I addr to it; @@ -37,7 +37,7 @@ is interpreted as either an for the "set" operations, or as an .IR "unsigned long\ *" , for the "get" operations. -.PP +.P Subfunctions for both x86 and x86-64 are: .TP .BR ARCH_SET_CPUID " (since Linux 4.12)" @@ -120,8 +120,8 @@ is set to indicate the error. points to an unmapped address or is outside the process address space. .TP .B EINVAL -.I code -is not a valid subcommand. +.I op +is not a valid operation. .TP .B ENODEV .B ARCH_SET_CPUID @@ -137,12 +137,12 @@ Linux/x86-64. .SH NOTES .BR arch_prctl () is supported only on Linux/x86-64 for 64-bit programs currently. -.PP +.P The 64-bit base changes when a new 32-bit segment selector is loaded. -.PP +.P .B ARCH_SET_GS is disabled in some kernels. -.PP +.P Context switches for 64-bit segment bases are rather expensive. As an optimization, if a 32-bit TLS base address is used, .BR arch_prctl () @@ -154,14 +154,14 @@ Memory in the first 2\ GB of address space can be allocated by using with the .B MAP_32BIT flag. -.PP +.P Because of the aforementioned optimization, using .BR arch_prctl () and .BR set_thread_area (2) in the same thread is dangerous, as they may overwrite each other's TLS entries. -.PP +.P .I FS may be already used by the threading library. Programs that use @@ -172,5 +172,5 @@ directly are very likely to crash. .BR modify_ldt (2), .BR prctl (2), .BR set_thread_area (2) -.PP +.P AMD X86-64 Programmer's manual |