Module prctl

Source
Expand description

Bindings for the Linux prctl system call.

There are similarities (but also differences) with FreeBSD’s procctl system call, whose interface is located in the procctl.rs file.

StructsΒ§

FloatingPointEmulationControl
PR_FPEMU_* flags for use with floating_point_emulation_control and set_floating_point_emulation_control.
FloatingPointExceptionMode
Zero means floating point exceptions are disabled.
PrctlMmMap
This structure provides new memory descriptor map which mostly modifies /proc/pid/stat[m] output for a task. This mostly done in a sake of checkpoint/restore functionality.
SpeculationFeatureControl
PR_SPEC_* flags for use with control_speculative_feature.
SpeculationFeatureState
Zero means the processors are not vulnerable.
UnalignedAccessControl
PR_UNALIGN_* flags for use with unaligned_access_control and set_unaligned_access_control.

EnumsΒ§

DumpableBehavior
SUID_DUMP_* values for use with dumpable_behavior and set_dumpable_behavior.
EndianMode
PR_ENDIAN_* values for use with endian_mode.
FloatingPointMode
PR_FP_MODE_* values for use with floating_point_mode and set_floating_point_mode.
MachineCheckMemoryCorruptionKillPolicy
PR_MCE_KILL_* values for use with machine_check_memory_corruption_kill_policy and set_machine_check_memory_corruption_kill_policy.
PTracer
Process ptracer.
SpeculationFeature
PR_SPEC_* values for use with speculative_feature_state and control_speculative_feature.
TimeStampCounterReadability
PR_TSC_* values for use with time_stamp_counter_readability and set_time_stamp_counter_readability.
TimingMethod
PR_TIMING_* values for use with timing_method and set_timing_method.
VirtualMemoryMapAddress
PR_SET_MM_* values for use with set_virtual_memory_map_address.

ConstantsΒ§

PR_ENDIAN_BIG πŸ”’
PR_ENDIAN_LITTLE πŸ”’
PR_ENDIAN_PPC_LITTLE πŸ”’
PR_FP_MODE_FR πŸ”’
PR_FP_MODE_FRE πŸ”’
PR_GET_CHILD_SUBREAPER πŸ”’
PR_GET_DUMPABLE πŸ”’
PR_GET_ENDIAN πŸ”’
PR_GET_FPEMU πŸ”’
PR_GET_FPEXC πŸ”’
PR_GET_FP_MODE πŸ”’
PR_GET_IO_FLUSHER πŸ”’
PR_GET_PDEATHSIG πŸ”’
PR_GET_SPECULATION_CTRL πŸ”’
PR_GET_TIMING πŸ”’
PR_GET_TSC πŸ”’
PR_GET_UNALIGN πŸ”’
PR_MCE_KILL πŸ”’
PR_MCE_KILL_CLEAR πŸ”’
PR_MCE_KILL_DEFAULT πŸ”’
PR_MCE_KILL_EARLY πŸ”’
PR_MCE_KILL_GET πŸ”’
PR_MCE_KILL_LATE πŸ”’
PR_MCE_KILL_SET πŸ”’
PR_PAC_GET_ENABLED_KEYS πŸ”’
PR_PAC_SET_ENABLED_KEYS πŸ”’
PR_SET_CHILD_SUBREAPER πŸ”’
PR_SET_DUMPABLE πŸ”’
PR_SET_ENDIAN πŸ”’
PR_SET_FPEMU πŸ”’
PR_SET_FPEXC πŸ”’
PR_SET_FP_MODE πŸ”’
PR_SET_IO_FLUSHER πŸ”’
PR_SET_MM πŸ”’
PR_SET_MM_ARG_END πŸ”’
PR_SET_MM_ARG_START πŸ”’
PR_SET_MM_AUXV πŸ”’
PR_SET_MM_BRK πŸ”’
PR_SET_MM_END_CODE πŸ”’
PR_SET_MM_END_DATA πŸ”’
PR_SET_MM_ENV_END πŸ”’
PR_SET_MM_ENV_START πŸ”’
PR_SET_MM_EXE_FILE πŸ”’
PR_SET_MM_MAP πŸ”’
PR_SET_MM_MAP_SIZE πŸ”’
PR_SET_MM_START_BRK πŸ”’
PR_SET_MM_START_CODE πŸ”’
PR_SET_MM_START_DATA πŸ”’
PR_SET_MM_START_STACK πŸ”’
PR_SET_PDEATHSIG πŸ”’
PR_SET_PTRACER πŸ”’
PR_SET_PTRACER_ANY πŸ”’
PR_SET_SPECULATION_CTRL πŸ”’
PR_SET_TIMING πŸ”’
PR_SET_TSC πŸ”’
PR_SET_UNALIGN πŸ”’
PR_SET_VMA πŸ”’
PR_SET_VMA_ANON_NAME πŸ”’
PR_SPEC_INDIRECT_BRANCH πŸ”’
PR_SPEC_L1D_FLUSH πŸ”’
PR_SPEC_STORE_BYPASS πŸ”’
PR_TASK_PERF_EVENTS_DISABLE πŸ”’
PR_TASK_PERF_EVENTS_ENABLE πŸ”’
PR_TIMING_STATISTICAL πŸ”’
PR_TIMING_TIMESTAMP πŸ”’
PR_TSC_ENABLE πŸ”’
PR_TSC_SIGSEGV πŸ”’
SUID_DUMP_DISABLE πŸ”’
SUID_DUMP_ROOT πŸ”’
SUID_DUMP_USER πŸ”’

FunctionsΒ§

child_subreaper
Get the child subreaper setting of the calling process.
configure_io_flusher_behavior
Put the process in the IO_FLUSHER state, allowing it to make progress when allocating memory.
configure_performance_counters
Enable or disable all performance counters attached to the calling process.
configure_pointer_authentication_keys⚠
Set enabled pointer authentication keys.
configure_virtual_memory_map⚠
Provides one-shot access to all the addresses by passing in a PrctlMmMap.
control_speculative_feature
Sets the state of the speculation misfeature.
dumpable_behavior
Get the current state of the calling process’ dumpable attribute.
enabled_pointer_authentication_keys
Get enabled pointer authentication keys.
endian_mode
Get the endianness of the calling process.
floating_point_emulation_control
Get floating point emulation control bits.
floating_point_exception_mode
Get floating point exception mode.
floating_point_mode
Get the current floating point mode.
is_io_flusher
Get the IO_FLUSHER state of the caller.
machine_check_memory_corruption_kill_policy
Get the current per-process machine check kill policy.
parent_process_death_signal
Get the current value of the parent process death signal.
set_auxiliary_vector⚠
Set a new auxiliary vector.
set_child_subreaper
Set the child subreaper attribute of the calling process.
set_dumpable_behavior
Set the state of the dumpable attribute.
set_endian_mode⚠
Set the endianness of the calling process.
set_executable_file
Supersede the /proc/pid/exe symbolic link with a new one pointing to a new executable file.
set_floating_point_emulation_control
Set floating point emulation control bits.
set_floating_point_exception_mode
Set floating point exception mode.
set_floating_point_mode
Allow control of the floating point mode from user space.
set_machine_check_memory_corruption_kill_policy
Set the machine check memory corruption kill policy for the calling thread.
set_parent_process_death_signal
Set the parent-death signal of the calling process.
set_ptracer
Declare that the ptracer process can ptrace the calling process as if it were a direct process ancestor.
set_time_stamp_counter_readability
Set the state of the flag determining if the timestamp counter can be read by the process.
set_timing_method
Set whether to use (normal, traditional) statistical process timing or accurate timestamp-based process timing.
set_unaligned_access_control
Set unaligned access control bits.
set_virtual_memory_map_address⚠
Modify certain kernel memory map descriptor addresses of the calling process.
set_virtual_memory_region_name
Set the name for a virtual memory region.
speculative_feature_state
Get the state of the speculation misfeature.
time_stamp_counter_readability
Get the state of the flag determining if the timestamp counter can be read.
timing_method
Get which process timing method is currently in use.
unaligned_access_control
Get unaligned access control bits.
virtual_memory_map_config_struct_size
Get the size of the PrctlMmMap the kernel expects.