Skip to main content

Module thread

Module thread 

Source
Available on crate feature thread only.
Expand description

Thread-associated operations.

Modules§

futexlinux_kernel
Linux futex.

Structs§

CapabilitiesSecureBitslinux_kernel
SECBIT_*
CapabilitySetlinux_kernel
CAP_* constants.
CapabilitySetslinux_kernel
__user_cap_data_struct
CpuSetfreebsdlike or linux_kernel or Fuchsia
CpuSet represents a bit-mask of CPUs.
Cpuidlinux_kernel
A Linux CPU ID.
Gid
gid_t—A Unix group ID.
MembarrierQuerylinux_kernel
A result from membarrier_query.
Pid
pid_t—A non-zero Unix process ID.
SVEVectorLengthConfiglinux_kernel
Scalable Vector Extension vector length configuration.
TaggedAddressModelinux_kernel
Zero means addresses that are passed for the purpose of being dereferenced by the kernel must be untagged.
ThreadNameSpaceTypelinux_kernel
Thread name space type.
Timespec
struct timespec—A quantity of time in seconds plus nanoseconds.
Uid
uid_t—A Unix user ID.
UnshareFlagslinux_kernel
CLONE_* for use with unshare.

Enums§

CapabilityDeprecatedlinux_kernel
Linux per-thread capability.
ClockIdNeither apple nor DragonFly BSD nor target_os=espidf nor FreeBSD nor OpenBSD nor Redox nor target_os=vita nor WASI
CLOCK_* constants for use with clock_gettime.
CoreSchedulingScopelinux_kernel
PR_SCHED_CORE_SCOPE_*
LinkNameSpaceTypelinux_kernel
Type of name space referred to by a link.
MembarrierCommand
A command for use with membarrier and membarrier_cpu.
NanosleepRelativeResultNon-Redox
A return type for nanosleep and clock_nanosleep_relative.
SecureComputingModelinux_kernel
SECCOMP_MODE_*
SysCallUserDispatchFastSwitchlinux_kernel
Value of the fast switch flag controlling system calls user dispatch mechanism without the need to issue a syscall.

Traits§

CompatCapabilitylinux_kernel
Compatibility trait to keep existing code that uses the deprecated Capability type working.

Functions§

capabilitieslinux_kernel
capget(_LINUX_CAPABILITY_VERSION_3, pid)
capabilities_secure_bitslinux_kernel
Get the securebits flags of the calling thread.
capability_is_in_ambient_setlinux_kernel
Check if the specified capability is in the ambient set.
capability_is_in_bounding_setlinux_kernel
Check if the specified capability is in the calling thread’s capability bounding set.
clear_ambient_capability_setlinux_kernel
Remove all capabilities from the ambient set.
clock_nanosleep_absoluteNon-Redox and neither apple nor DragonFly BSD nor Emscripten nor target_os=espidf nor FreeBSD nor Haiku nor target_os=horizon nor OpenBSD nor Redox nor target_os=vita nor WASI
clock_nanosleep(id, TIMER_ABSTIME, request, NULL)—Sleeps until an absolute time on a given clock.
clock_nanosleep_relativeNon-Redox and neither apple nor DragonFly BSD nor Emscripten nor target_os=espidf nor FreeBSD nor Haiku nor target_os=horizon nor OpenBSD nor Redox nor target_os=vita nor WASI
clock_nanosleep(id, 0, request, remain)—Sleeps for a duration on a given clock.
configure_capability_in_ambient_setlinux_kernel
Add or remove the specified capability to the ambient set.
core_scheduling_cookielinux_kernel
Get core scheduling cookie of a process.
create_core_scheduling_cookielinux_kernel
Create unique core scheduling cookie.
current_tagged_address_modelinux_kernel
Get the current tagged address mode for the calling thread.
current_timer_slacklinux_kernel
Get the current timer slack value of the calling thread.
disable_syscall_user_dispatchlinux_kernel
Disable Syscall User Dispatch mechanism.
disable_transparent_huge_pageslinux_kernel
Set the state of the THP disable flag for the calling thread.
enable_syscall_user_dispatchlinux_kernel
Enable Syscall User Dispatch mechanism.
get_clear_child_tid_addresslinux_kernel
Get the clear_child_tid address set by set_tid_address and clone’s CLONE_CHILD_CLEARTID flag.
get_keep_capabilitieslinux_kernel
Get the current state of the calling thread’s keep capabilities flag.
gettidlinux_kernel
gettid()—Returns the thread ID.
membarrierlinux_kernel
membarrier(cmd, 0, 0)—Perform a memory barrier.
membarrier_cpulinux_kernel
membarrier(cmd, MEMBARRIER_CMD_FLAG_CPU, cpu)—Perform a memory barrier with a specific CPU.
membarrier_querylinux_kernel
membarrier(MEMBARRIER_CMD_QUERY, 0, 0)—Query the supported membarrier commands.
move_into_link_name_spacelinux_kernel
Reassociate the calling thread with the namespace associated with link referred to by fd.
move_into_thread_name_spaceslinux_kernel
Atomically move the calling thread into one or more of the same namespaces as the thread referred to by fd.
namealloc
Get the name of the calling thread.
nanosleepNon-Redox
nanosleep(request, remain)—Sleeps for a duration.
no_new_privslinux_kernel
Get the value of the no_new_privs attribute for the calling thread.
pull_core_scheduling_cookielinux_kernel
Pull core scheduling cookie from a process.
push_core_scheduling_cookielinux_kernel
Push core scheduling cookie to a process.
remove_capability_from_bounding_setlinux_kernel
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_keyslinux_kernel and linux_raw_dep
Securely reset the thread’s pointer authentication keys to fresh random values generated by the kernel.
sched_getaffinityfreebsdlike or linux_kernel or Fuchsia
sched_getaffinity(pid)—Get a thread’s CPU affinity mask.
sched_getcpu(freebsdlike or linux_kernel or Fuchsia) and (linux_kernel or DragonFly BSD)
sched_getcpu()—Get the CPU that the current thread is currently on.
sched_setaffinityfreebsdlike or linux_kernel or Fuchsia
sched_setaffinity(pid, cpuset)—Set a thread’s CPU affinity mask.
sched_yield
sched_yield()—Hints to the OS that other processes should run.
secure_computing_modelinux_kernel
Get the secure computing mode of the calling thread.
set_capabilitieslinux_kernel
capset(_LINUX_CAPABILITY_VERSION_3, pid, effective, permitted, inheritable)
set_capabilities_secure_bitslinux_kernel
Set the securebits flags of the calling thread.
set_current_tagged_address_modelinux_kernel
Controls support for passing tagged user-space addresses to the kernel.
set_current_timer_slacklinux_kernel
Sets the current timer slack value for the calling thread.
set_keep_capabilitieslinux_kernel
Set the state of the calling thread’s keep capabilities flag.
set_namelinux_kernel
Set the name of the calling thread.
set_no_new_privslinux_kernel
Set the calling thread’s no_new_privs attribute.
set_secure_computing_modelinux_kernel
Set the secure computing mode for the calling thread, to limit the available system calls.
set_sve_vector_length_configurationlinux_kernel
Configure the thread’s vector length of Scalable Vector Extension.
set_thread_gidlinux_kernel
setgid(gid)—Sets the effective group ID of the current thread.
set_thread_groupslinux_kernel
setgroups(groups)—Sets the supplementary group IDs for the calling thread.
set_thread_res_gidlinux_kernel
setresgid(rgid, egid, sgid)—Sets the real, effective, and saved group ID of the current thread.
set_thread_res_uidlinux_kernel
setresuid(ruid, euid, suid)—Sets the real, effective, and saved user ID of the calling thread.
set_thread_uidlinux_kernel
setuid(uid)—Sets the effective user ID of the calling thread.
sve_vector_length_configurationlinux_kernel
Get the thread’s current SVE vector length configuration.
transparent_huge_pages_are_disabledlinux_kernel
Get the current setting of the THP disable flag for the calling thread.
unshareDeprecatedlinux_kernel
unshare(flags)—Deprecated in favor of unshare_unsafe.
unshare_unsafelinux_kernel
unshare(flags)—Disassociate parts of the current thread’s execution context with other threads.

Type Aliases§

CapabilityFlagsDeprecatedlinux_kernel
Previous name of CapabilitySet.
Nsecs
A type for the tv_nsec 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.