]> git.ipfire.org Git - thirdparty/util-linux.git/blame - sys-utils/setarch.8
su: change error message
[thirdparty/util-linux.git] / sys-utils / setarch.8
CommitLineData
2b798ecd 1.TH SETARCH 8 "December 2017" "util-linux" "System Administration"
8b3a46d2 2.SH NAME
05541825 3setarch \- change reported architecture in new program environment and/or set personality flags
8b3a46d2 4.SH SYNOPSIS
181ebbb3 5.B setarch
05541825 6.RI [ arch ]
c372860d 7[options]
181ebbb3 8.RI [ program
6ad5b22c
BS
9.RI [ argument ...]]
10.sp
05541825
KZ
11.B setarch
12.BR \-\-list | \-h | \-V
13.sp
6ad5b22c
BS
14.B arch
15[options]
16.RI [ program
17.RI [ argument ...]]
8b3a46d2
KZ
18.SH DESCRIPTION
19.B setarch
05541825
KZ
20modifies execution domains and process personality flags.
21.PP
22The execution domains currently only affects the output of \fBuname -m\fR.
6ad5b22c
BS
23For example, on an AMD64 system, running \fBsetarch i386 \fIprogram\fR
24will cause \fIprogram\fR to see i686 instead of x86_64 as the machine type.
25It also allows to set various personality options.
26The default \fIprogram\fR is \fB/bin/sh\fR.
05541825
KZ
27.PP
28Since version 2.33 the
29.I arch
b9c3b903 30command line argument is optional and
05541825
KZ
31.B setarch
32may be used to change personality flags (ADDR_LIMIT_*, SHORT_INODE, etc) without
33modification of the execution domain.
8b3a46d2
KZ
34.SH OPTIONS
35.TP
8854b121
BS
36.B \-\-list
37List the architectures that \fBsetarch\fR knows about. Whether \fBsetarch\fR
38can actually set each of these architectures depends on the running kernel.
e0771cf8 39.TP
8854b121
BS
40.B \-\-uname\-2.6
41Causes the \fIprogram\fR to see a kernel version number beginning with 2.6.
2b798ecd 42Turns on UNAME26.
70eebc40 43.TP
c372860d
BS
44.BR \-v , " \-\-verbose"
45Be verbose.
46.TP
edd82b9c 47\fB\-3\fR, \fB\-\-3gb\fR
2b798ecd
SK
48Specifies
49.I program
50should use a maximum of 3GB of address space. Supported on x86. Turns on
51ADDR_LIMIT_3GB.
8b3a46d2 52.TP
edd82b9c 53\fB\-\-4gb\fR
2b798ecd
SK
54This option has no effect. It is retained for backward compatibility only,
55and may be removed in future releases.
edd82b9c
KZ
56.TP
57\fB\-B\fR, \fB\-\-32bit\fR
2b798ecd
SK
58Limit the address space to 32 bits to emulate hardware. Supported on ARM
59and Alpha. Turns on ADDR_LIMIT_32BIT.
8b3a46d2 60.TP
edd82b9c 61\fB\-F\fR, \fB\-\-fdpic\-funcptrs\fR
2b798ecd
SK
62Treat user-space function pointers to signal handlers as pointers to address
63descriptors. This option has no effect on architectures that do not support
64FDPIC ELF binaries. In kernel v4.14 support is limited to ARM, Blackfin,
65Fujitsu FR-V, and SuperH CPU architectures.
8b3a46d2 66.TP
edd82b9c 67\fB\-I\fR, \fB\-\-short\-inode\fR
2b798ecd 68Obsolete bug emulation flag. Turns on SHORT_INODE.
8b3a46d2 69.TP
edd82b9c 70\fB\-L\fR, \fB\-\-addr\-compat\-layout\fR
2b798ecd
SK
71Provide legacy virtual address space layout. Use when the
72.I program
73binary does not have PT_GNU_STACK ELF header. Turns on
74ADDR_COMPAT_LAYOUT.
8b3a46d2 75.TP
edd82b9c 76\fB\-R\fR, \fB\-\-addr\-no\-randomize\fR
2b798ecd
SK
77Disables randomization of the virtual address space. Turns on
78ADDR_NO_RANDOMIZE.
8b3a46d2 79.TP
edd82b9c 80\fB\-S\fR, \fB\-\-whole\-seconds\fR
2b798ecd 81Obsolete bug emulation flag. Turns on WHOLE_SECONDS.
8b3a46d2 82.TP
edd82b9c 83\fB\-T\fR, \fB\-\-sticky\-timeouts\fR
2b798ecd
SK
84This makes
85.BR select (2),
86.BR pselect (2),
87and
88.BR ppoll (2)
89system calls preserve the timeout value instead of modifying it to reflect
90the amount of time not slept when interrupted by a signal handler. Use when
91.I program
92depends on this behavior. For more details see the timeout description in
93.BR select (2)
94manual page. Turns on STICKY_TIMEOUTS.
8b3a46d2 95.TP
edd82b9c 96\fB\-X\fR, \fB\-\-read\-implies\-exec\fR
2b798ecd
SK
97If this is set then
98.BR mmap (3)
99PROT_READ will also add the PROT_EXEC bit - as expected by legacy x86
100binaries. Notice that the ELF loader will automatically set this bit when
101it encounters a legacy binary. Turns on READ_IMPLIES_EXEC.
8b3a46d2 102.TP
edd82b9c 103\fB\-Z\fR, \fB\-\-mmap\-page\-zero\fR
2b798ecd
SK
104SVr4 bug emulation that will set
105.BR mmap (3)
106page zero as read-only. Use when
107.I program
108depends on this behavior, and the source code is not available to be fixed.
8b3a46d2 109Turns on MMAP_PAGE_ZERO.
c372860d
BS
110.TP
111.BR \-V , " \-\-version"
112Display version information and exit.
113.TP
114.BR \-h , " \-\-help"
115Display help text and exit.
8b3a46d2 116.SH EXAMPLES
05541825
KZ
117setarch --addr-no-randomize mytestprog
118.br
8b3a46d2
KZ
119setarch ppc32 rpmbuild --target=ppc --rebuild foo.src.rpm
120.br
121setarch ppc32 -v -vL3 rpmbuild --target=ppc --rebuild bar.src.rpm
8df90dec
KZ
122.br
123setarch ppc32 --32bit rpmbuild --target=ppc --rebuild foo.src.rpm
8b3a46d2 124.SH AUTHOR
79f84818 125.MT sopwith@redhat.com
e0771cf8 126Elliot Lee
79f84818 127.ME
8b3a46d2 128.br
79f84818 129.MT jnovy@redhat.com
e0771cf8 130Jindrich Novy
79f84818 131.ME
05541825
KZ
132.br
133.MT kzak@redhat.com
134Karel Zak
135.ME
2b798ecd
SK
136.SH "SEE ALSO"
137.BR personality (2),
138.BR select (2)
8b3a46d2 139.SH AVAILABILITY
601d12fb 140The setarch command is part of the util-linux package and is available from
d673b74e 141.UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
e0771cf8
SK
142Linux Kernel Archive
143.UE .