int arch_prctl(int code, uint64_t argument);
This syscall interacts with architecture-specific thread-local storage. For x86_64, these are the available codes:
ARCH_SET_FS (1)
Sets argument
as the current thread’s FS.
ARCH_GET_FS (2)
Stores the current thread’s FS into the variable pointed to by argument
.
ARCH_SET_GS (3)
Sets argument
as the current thread’s FS.
ARCH_GET_GS (4)
Stores the current thread’s GS into the variable pointed to by argument
.
This syscall returns 0
on success, and -1
on failure.
errno is to be set to the following values on failure:
EINVAL
: code
is not valid.
EFAULT
: argument
is outside the available address space.