Module thread

Available on crate feature dep_rustix only.
Expand description

Thread-associated operations.

Modules§

futex
Linux futex.

Structs§

CapabilitiesSecureBits
SECBIT_*.
CapabilityFlags
CAP_* constants.
CapabilitySets
__user_cap_data_struct
FutexFlags
FUTEX_* flags for use with the functions in futex.
Gid
gid_t—A Unix group ID.
Pid
pid_t—A non-zero Unix process ID.
SVEVectorLengthConfig
Scalable Vector Extension vector length configuration.
TaggedAddressMode
Zero means addresses that are passed for the purpose of being dereferenced by the kernel must be untagged.
ThreadNameSpaceType
Thread name space type.
Uid
uid_t—A Unix user ID.
UnshareFlags
CLONE_* for use with unshare.

Enums§

Capability
Linux per-thread capability.
ClockId
CLOCK_* constants for use with clock_gettime.
CoreSchedulingScope
PR_SCHED_CORE_SCOPE_*.
FutexOperation
FUTEX_* operations for use with the futex function.
LinkNameSpaceType
Type of name space referred to by a link.
NanosleepRelativeResult
A return type for nanosleep and clock_nanosleep_relative.
SecureComputingMode
SECCOMP_MODE_*.
SysCallUserDispatchFastSwitch
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 by set_tid_address and clone’s CLONE_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.

Type Aliases§

Nsecs
A type for the tv_sec field of Timespec.
RawGid
A group identifier as a raw integer.
RawPid
A process identifier as a raw integer.
RawUid
A user identifier as a raw integer.
Secs
A type for the tv_sec field of Timespec.
Timespec
struct timespec