PRCTL(1)
๐ PRCTL(1) โ Process operations ๐
okay bestie, so this is a page from the General Commands Manual, and it's literally all about the prctl command. sit down, grab a boba, we're doing process vibes today. ๐งโจ
โจ NAME โจ
prctl โ process operations. that's it, that's the whole name. iconic behavior honestly. ๐
๐ SYNOPSIS ๐
prctl [-v] [-h|--help] [--version] <-q|<options....>> [command]
where <options> are:
--unaligned=[silent|signal|always-signal|default]
--fpemu=[silent|signal|default]
--mcekill=[early|late|default]
so yeah, you gotta pick your lane: either -q (just peek at the settings) or one or more of those options up there. no half-committing. ๐ซถ
๐ธ DESCRIPTION ๐ธ
prctl lets you query or control certain process behavior. supported options are:
Unaligned memory access: when a process does an unaligned memory access, the default is that the kernel emulates it correctly and logs the unaligned access in syslog. but like, you can change that. the kernel could emulate the unaligned access correctly without logging an error (silent), or it could send SIGBUS to the process (signal and always-signal). heads up: always-signal is available on ia64 only. ๐
Floating point assistance faults: when a process hits a floating point assist fault, the kernel would invoke the floating point emulator and log the fault. you can flip that too โ the kernel could emulate the floating point operation without logging an error (silent), or send SIGFPE to the offending process (signal). ๐ค
Machine check memory corruption kill policy: if a hardware memory corruption is detected inside a thread's address space, the memory corruption kill policy decides whether that thread gets SIGBUS the second the corruption is detected (early), when it actually accesses the corrupted memory (late), or just uses the system wide default. pick your fighter. ๐ฅ
prctl can optionally be followed by a command. if a command is specified, prctl will exec the command with the processor behavior set to whatever you asked for in the options. if there's no command, prctl will fork a new shell โ unless the command only queried the current settings. ๐
the shell started by prctl is the one defined by the environment variable SHELL. if SHELL isn't defined, then the shell in the password entry for the user gets started. and if there's no shell in the password entry either? bash gets started. slay. โจ
โญ OPTIONS โญ
-vโ verbose mode. in verbose mode, any new settings are confirmed with a message onstdout. it's giving receipts. ๐งพ--helpโ print usage information and exit. bestie just wants to read the instructions. ๐--versionโ print software version and exit. ๐-qโ query the current settings for the process options controllable byprctl. the vibe check of options. ๐--unaligned=[silent|signal|always-signal|default]]โ set unaligned memory access behavior to not log the access (silent), sendSIGBUSto the process (signal), or do the default (default). on IA-64 architecture there's an extra value,always-signal, which causes aSIGBUSto be generated every single time an unaligned access occurs. for the deets on when an unaligned access would not generate a signal normally, refer to the section titled "Memory Datum Alignment and Atomicity" in "Intel IA-64 Architecture Software Developer's Manual: Volume 2". if you don't specify a value after=, the current setting is returned. no cap. ๐--fpemu=[silent|signal|default]]โ set floating point assist fault behavior to not log the fault (silent), sendSIGFPEto the process (signal), or do the default (default). if no value is specified after=, the current setting is returned. ๐งฎ
if an option is specified multiple times, the last one takes effect. so don't fight yourself, the last word wins. periodt. ๐
๐ EXAMPLES ๐
prctl --unaligned=signalstarts up a shell (as defined by the environment variableSHELL) and sets up any process running under this shell to be sentSIGBUSupon an unaligned memory access. ๐ญprctl --unaligned=signal gdb tststarts up agdbsession for the program "tst" with the process set to receiveSIGBUSupon unaligned memory access. debug era. ๐prctl --unaligned=displays the current setting for unaligned memory access handling. ๐prctl --unaligned= gdb tstdisplays the current setting for unaligned memory access handling and starts up agdbsession for the program "tst". multitasking queen. ๐
๐ NOTES ๐
prctl works on 2.4.0 and above kernels only. old kernel? not me. ๐
the --fpemu= option is specific to IPF (Itanium Processor Family, previously known as IA-64) and is supported on kernels 2.4.11 and above. other architectures and kernels may return an "Invalid argument" error. so like, know your architecture bestie. ๐ฆ
๐ SEE ALSO ๐
๐ซถ AUTHOR ๐ซถ
Khalid Aziz <khalid.aziz@oracle.com>
๐ LICENSE ๐
this software is made available under the GNU General Public License (GPL) Version 2. this software comes with NO WARRANTY. read that again, fr fr. ๐ค
okay so that's the whole page, we ate and left no crumbs. ๐ one last thing before you go: this is the prctl page, "Process operations", out of the General Commands Manual โ PRCTL(1) if you're being fancy. go set some process behavior, you main character. bye bestie! ๐โจ๐
๐ฆ where this page comes from
- debian bookworm: prctl 1.6-1+b1
- debian trixie: prctl 1.7-1
- nixos 26.05: prctl 1.7
- nixpkgs unstable: prctl 1.7
- opensuse-leap 16.0: prctl 1.7-160000.2.2 ยท GPL-2.0-or-later
- opensuse-leap 16.0: prctl 1.7-160000.2.2 ยท GPL-2.0-or-later
- opensuse-leap 16.0: prctl 1.7-160000.2.2 ยท GPL-2.0-or-later
- opensuse-leap 16.0: prctl 1.7-160000.2.2 ยท GPL-2.0-or-later
- ubuntu jammy: prctl 1.6-1build1
- ubuntu noble: prctl 1.6-1build1
- ubuntu questing: prctl 1.7-1
- ubuntu resolute: prctl 1.7-1build1
- ubuntu stonking: prctl 1.7-1build1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms