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 architecturessetarchknows 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 thepersonalityargument, it shows that personality instead of the current one.personalityis a hexadecimal number, and the possible values live insys/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 with2.6. turns onUNAME26. 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 onADDR_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 onADDR_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 onSHORT_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 aPT_GNU_STACKELF header. turns onADDR_COMPAT_LAYOUT.-R,--addr-no-randomizeโ disables randomization of the virtual address space. turns onADDR_NO_RANDOMIZE. chaos off ๐-S,--whole-secondsโ another obsolete bug emulation flag. turns onWHOLE_SECONDS.-T,--sticky-timeoutsโ this makes theselect(2),pselect(2), andppoll(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 theselect(2)manual page. turns onSTICKY_TIMEOUTS.-X,--read-implies-execโ if this is set, thenmmap(2)withPROT_READwill also add thePROT_EXECbit โ 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 onREAD_IMPLIES_EXEC.-Z,--mmap-page-zeroโ SVr4 bug emulation that setsmmap(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 onMMAP_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