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