Module thread
Available on crate feature
dep_rustix
only.Expand description
Thread-associated operations.
Modules§
- futex
- Linux
futex
.
Structs§
- Capabilities
Secure Bits SECBIT_*
.- Capability
Flags CAP_*
constants.- Capability
Sets __user_cap_data_struct
- Futex
Flags FUTEX_*
flags for use with the functions infutex
.- Gid
gid_t
—A Unix group ID.- Pid
pid_t
—A non-zero Unix process ID.- SVEVector
Length Config - Scalable Vector Extension vector length configuration.
- Tagged
Address Mode - Zero means addresses that are passed for the purpose of being dereferenced by the kernel must be untagged.
- Thread
Name Space Type - Thread name space type.
- Uid
uid_t
—A Unix user ID.- Unshare
Flags CLONE_*
for use withunshare
.
Enums§
- Capability
- Linux per-thread capability.
- ClockId
CLOCK_*
constants for use withclock_gettime
.- Core
Scheduling Scope PR_SCHED_CORE_SCOPE_*
.- Futex
Operation FUTEX_*
operations for use with thefutex
function.- Link
Name Space Type - Type of name space referred to by a link.
- Nanosleep
Relative Result - A return type for
nanosleep
andclock_nanosleep_relative
. - Secure
Computing Mode SECCOMP_MODE_*
.- SysCall
User Dispatch Fast Switch - Value of the fast switch flag controlling system calls user dispatch mechanism without the need to issue a syscall.
Constants§
- FUTEX_
OWNER_ DIED FUTEX_OWNER_DIED
- FUTEX_
WAITERS FUTEX_WAITERS
Functions§
- capabilities
capget(_LINUX_CAPABILITY_VERSION_3, pid)
- capabilities_
secure_ bits - Get the
securebits
flags of the calling thread. - capability_
is_ in_ ambient_ set - Check if the specified capability is in the ambient set.
- capability_
is_ in_ bounding_ set - Check if the specified capability is in the calling thread’s capability bounding set.
- clear_
ambient_ capability_ set - Remove all capabilities from the ambient set.
- clock_
nanosleep_ absolute clock_nanosleep(id, TIMER_ABSTIME, request, NULL)
—Sleeps until an absolute time on a given clock.- clock_
nanosleep_ relative clock_nanosleep(id, 0, request, remain)
—Sleeps for a duration on a given clock.- configure_
capability_ in_ ambient_ set - Add or remove the specified capability to the ambient set.
- core_
scheduling_ cookie - Get core scheduling cookie of a process.
- create_
core_ scheduling_ cookie - Create unique core scheduling cookie.
- current_
tagged_ address_ mode - Get the current tagged address mode for the calling thread.
- current_
timer_ slack - Get the
current
timer slack value of the calling thread. - disable_
syscall_ ⚠user_ dispatch - Disable Syscall User Dispatch mechanism.
- disable_
transparent_ huge_ pages - Set the state of the
THP disable
flag for the calling thread. - enable_
syscall_ ⚠user_ dispatch - Enable Syscall User Dispatch mechanism.
- futex⚠
- DEPRECATED: There are now individual functions available to perform futex operations with improved type safety. See the futex module.
- get_
clear_ child_ tid_ address - Get the
clear_child_tid
address set byset_tid_address
andclone
’sCLONE_CHILD_CLEARTID
flag. - get_
keep_ capabilities - Get the current state of the calling thread’s
keep capabilities
flag. - gettid
gettid()
—Returns the thread ID.- move_
into_ link_ name_ space - Reassociate the calling thread with the namespace associated with link
referred to by
fd
. - move_
into_ thread_ name_ spaces - Atomically move the calling thread into one or more of the same namespaces
as the thread referred to by
fd
. - name
- Get the name of the calling thread.
- nanosleep
nanosleep(request, remain)
—Sleeps for a duration.- no_
new_ privs - Get the value of the
no_new_privs
attribute for the calling thread. - pull_
core_ scheduling_ cookie - Pull core scheduling cookie from a process.
- push_
core_ scheduling_ cookie - Push core scheduling cookie to a process.
- remove_
capability_ from_ bounding_ set - If the calling thread has the
Capability::SetPermittedCapabilities
capability within its user namespace, then drop the specified capability from the thread’s capability bounding set. - reset_
pointer_ ⚠authentication_ keys - Securely reset the thread’s pointer authentication keys to fresh random values generated by the kernel.
- set_
capabilities capset(_LINUX_CAPABILITY_VERSION_3, pid, effective, permitted, inheritable)
- set_
capabilities_ secure_ bits - Set the
securebits
flags of the calling thread. - set_
current_ ⚠tagged_ address_ mode - Controls support for passing tagged user-space addresses to the kernel.
- set_
current_ timer_ slack - Sets the
current
timer slack value for the calling thread. - set_
keep_ capabilities - Set the state of the calling thread’s
keep capabilities
flag. - set_
name - Set the name of the calling thread.
- set_
no_ new_ privs - Set the calling thread’s
no_new_privs
attribute. - set_
secure_ computing_ mode - Set the secure computing mode for the calling thread, to limit the available system calls.
- set_
sve_ ⚠vector_ length_ configuration - Configure the thread’s vector length of Scalable Vector Extension.
- set_
thread_ gid setgid(gid)
- set_
thread_ groups setgroups(groups)
-Sets the supplementary group IDs for the calling thread.- set_
thread_ res_ gid setresgid(rgid, egid, sgid)
- set_
thread_ res_ uid setresuid(ruid, euid, suid)
- set_
thread_ uid setuid(uid)
- sve_
vector_ length_ configuration - Get the thread’s current SVE vector length configuration.
- transparent_
huge_ pages_ are_ disabled - Get the current setting of the
THP disable
flag for the calling thread. - unshare
unshare(flags)
—Disassociate parts of the current thread’s execution context with other threads.