SETARCH(8)

๐Ÿ’– SETARCH(8) ๐Ÿ’–

okay bestie, welcome to setarch โ€” it's a System Administration page, section 8, and it's lowkey one of the most underrated glow-ups in the util-linux lineup. sit down, hydrate, let's get into it โœจ


โœจ NAME โœจ

setarch โ€” change the reported architecture in a new program's environment, and/or mess with its personality flags ๐Ÿฆ‹


๐ŸŒธ SYNOPSIS ๐ŸŒธ

setarch [arch] [options] [program [argument...]]

arch [options] [program [argument...]]

๐Ÿ‘‘ DESCRIPTION ๐Ÿ‘‘

So setarch does two things: it tweaks the execution domain and the process personality flags. That's the whole vibe.

The execution domain, rn, only affects what uname -m spits out. Like, picture an AMD64 machine โ€” if you run setarch i386 program, then program will look around and see i686 instead of x86_64 as the machine type. gaslighting, but make it kernel-level ๐Ÿ’…

The default program, if you don't hand it one, is /bin/sh.

And here's the glow-up: since version 2.33, the arch command-line argument is optional. Which means you can use setarch purely to flip personality flags (ADDR_LIMIT_3GB, SHORT_INODE, etc) without touching the execution domain at all. main character energy, honestly ๐Ÿ‘‘


๐Ÿ’… OPTIONS ๐Ÿ’…

  • --list โ€” lists all the architectures setarch knows about. ngl tho, whether it can actually set each one depends on your running kernel. so it's giving "here's the menu, kitchen may vary" ๐Ÿ“
  • --show[=personality] โ€” shows the personality and flags that are active right now. if you pass the personality argument, it shows that personality instead of the current one. personality is a hexadecimal number, and the possible values live in sys/personality.h. go read it, it's a whole mood.
  • -p, --pid=pid โ€” when you use this alongside --show, it'll show the personality and flags of the process you specify. nosy in the best way ๐Ÿ™ˆ
  • --uname-2.6 โ€” makes the specified program see a kernel version number starting with 2.6. turns on UNAME26. blast from the past fr fr.
  • -v, --verbose โ€” be verbose. say more. spill โ˜•
  • -3, --3gb โ€” the specified program should cap itself at a maximum of 3GB of address space. supported on x86. turns on ADDR_LIMIT_3GB.
  • --4gb โ€” this option does nothing. it's hanging around purely for backward compatibility, and it may get yeeted in future releases. ๐Ÿ’€
  • -B, --32bit โ€” limits the address space to 32 bits to emulate hardware. supported on ARM and Alpha. turns on ADDR_LIMIT_32BIT.
  • -F, --fdpic-funcptrs โ€” treats user-space function pointers to signal handlers as pointers to address descriptors. this one has no effect on architectures that don't support FDPIC ELF binaries. and heads up: in kernel v4.14, support is limited to ARM, Blackfin, Fujitsu FR-V, and SuperH CPU architectures.
  • -I, --short-inode โ€” obsolete bug emulation flag. turns on SHORT_INODE. vintage, but not in a cute way.
  • -L, --addr-compat-layout โ€” gives you the legacy virtual address space layout. use it when the program binary doesn't have a PT_GNU_STACK ELF header. turns on ADDR_COMPAT_LAYOUT.
  • -R, --addr-no-randomize โ€” disables randomization of the virtual address space. turns on ADDR_NO_RANDOMIZE. chaos off ๐ŸŽ€
  • -S, --whole-seconds โ€” another obsolete bug emulation flag. turns on WHOLE_SECONDS.
  • -T, --sticky-timeouts โ€” this makes the select(2), pselect(2), and ppoll(2) system calls preserve the timeout value instead of modifying it to reflect how much time wasn't slept when a signal handler interrupted it. use this when your program depends on that behavior. for more deets, see the timeout description in the select(2) manual page. turns on STICKY_TIMEOUTS.
  • -X, --read-implies-exec โ€” if this is set, then mmap(2) with PROT_READ will also add the PROT_EXEC bit โ€” exactly what legacy x86 binaries expect. but notice: the ELF loader will automatically set this bit when it runs into a legacy binary anyway. turns on READ_IMPLIES_EXEC.
  • -Z, --mmap-page-zero โ€” SVr4 bug emulation that sets mmap(2) page zero as read-only. use it when your program depends on this behavior and you don't have the source code to fix it. turns on MMAP_PAGE_ZERO.
  • -h, --help โ€” display help text and exit. the classic escape hatch ๐Ÿซถ
  • -V, --version โ€” display version and exit.

๐ŸŒˆ EXAMPLES ๐ŸŒˆ

these are literally copy-paste ready, bestie:

setarch --addr-no-randomize mytestprog
setarch ppc32 rpmbuild --target=ppc --rebuild foo.src.rpm
setarch ppc32 -vL3 rpmbuild --target=ppc --rebuild bar.src.rpm
setarch ppc32 --32bit rpmbuild --target=ppc --rebuild foo.src.rpm
setarch --show
setarch --show=$(cat /proc/9284/personality)
setarch --show --pid 9284

๐Ÿงš AUTHORS ๐Ÿงš

Elliot Lee <sopwith@redhat.com>, Jindrich Novy <jnovy@redhat.com>, Karel Zak <kzak@redhat.com> โ€” icons, all three of them ๐Ÿ‘‘


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

personality(2), select(2) *proc_pid_personality(5)


๐ŸŽ€ REPORTING BUGS ๐ŸŽ€

found a bug? don't suffer in silence, bestie. use the issue tracker at <https://github.com/util-linux/util-linux/issues>. they want to hear it, fr fr.


โญ AVAILABILITY โญ

The setarch command is part of the util-linux package, which you can download from the Linux Kernel Archive at <https://www.kernel.org/pub/linux/utils/util-linux/>. go get your girl ๐Ÿ’œ


okay that's the whole page!! this is util-linux 2.42.4, dated 2026-09-21, and yes this is SETARCH(8) signing off. slay, stay safe, and remember: your personality flags are yours to choose ๐Ÿฆ‹โœจ

๐Ÿ“ฆ where this page comes from
  • arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms