{
    "mode": "man",
    "parameter": "linux64",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/linux64/8/json",
    "generated": "2026-05-30T07:07:49Z",
    "synopsis": "setarch [arch] [options] [program [argument...]]\nsetarch --list|-h|-V\narch [options] [program [argument...]]",
    "sections": {
        "NAME": {
            "content": "setarch - change reported architecture in new program environment and/or set personality\nflags\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "setarch [arch] [options] [program [argument...]]\n\nsetarch --list|-h|-V\n\narch [options] [program [argument...]]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "setarch modifies execution domains and process personality flags.\n\nThe execution domains currently only affects the output of uname -m. For example, on an AMD64\nsystem, running setarch i386 program will cause program to see i686 instead of x8664 as the\nmachine type. It can also be used to set various personality options. The default program is\n/bin/sh.\n\nSince version 2.33 the arch command line argument is optional and setarch may be used to\nchange personality flags (ADDRLIMIT*, SHORTINODE, etc) without modification of the\nexecution domain.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "--list",
                    "content": "List the architectures that setarch knows about. Whether setarch can actually set each of\nthese architectures depends on the running kernel.\n",
                    "long": "--list"
                },
                {
                    "name": "--uname-2.6",
                    "content": "Causes the program to see a kernel version number beginning with 2.6. Turns on UNAME26.\n",
                    "long": "--uname-2.6"
                },
                {
                    "name": "-v --verbose",
                    "content": "Be verbose.\n",
                    "flag": "-v",
                    "long": "--verbose"
                },
                {
                    "name": "-3 --3gb",
                    "content": "Specifies program should use a maximum of 3GB of address space. Supported on x86. Turns\non ADDRLIMIT3GB.\n",
                    "flag": "-3",
                    "long": "--3gb"
                },
                {
                    "name": "--4gb",
                    "content": "This option has no effect. It is retained for backward compatibility only, and may be\nremoved in future releases.\n",
                    "long": "--4gb"
                },
                {
                    "name": "-B --32bit",
                    "content": "Limit the address space to 32 bits to emulate hardware. Supported on ARM and Alpha. Turns\non ADDRLIMIT32BIT.\n",
                    "flag": "-B",
                    "long": "--32bit"
                },
                {
                    "name": "-F --fdpic-funcptrs",
                    "content": "Treat user-space function pointers to signal handlers as pointers to address descriptors.\nThis option has no effect on architectures that do not support FDPIC ELF binaries. In\nkernel v4.14 support is limited to ARM, Blackfin, Fujitsu FR-V, and SuperH CPU\narchitectures.\n",
                    "flag": "-F",
                    "long": "--fdpic-funcptrs"
                },
                {
                    "name": "-I --short-inode",
                    "content": "Obsolete bug emulation flag. Turns on SHORTINODE.\n",
                    "flag": "-I",
                    "long": "--short-inode"
                },
                {
                    "name": "-L --addr-compat-layout",
                    "content": "Provide legacy virtual address space layout. Use when the program binary does not have\nPTGNUSTACK ELF header. Turns on ADDRCOMPATLAYOUT.\n",
                    "flag": "-L",
                    "long": "--addr-compat-layout"
                },
                {
                    "name": "-R --addr-no-randomize",
                    "content": "Disables randomization of the virtual address space. Turns on ADDRNORANDOMIZE.\n",
                    "flag": "-R",
                    "long": "--addr-no-randomize"
                },
                {
                    "name": "-S --whole-seconds",
                    "content": "Obsolete bug emulation flag. Turns on WHOLESECONDS.\n",
                    "flag": "-S",
                    "long": "--whole-seconds"
                },
                {
                    "name": "-T --sticky-timeouts",
                    "content": "This makes select(2), pselect(2), and ppoll(2) system calls preserve the timeout value\ninstead of modifying it to reflect the amount of time not slept when interrupted by a\nsignal handler. Use when program depends on this behavior. For more details see the\ntimeout description in select(2) manual page. Turns on STICKYTIMEOUTS.\n",
                    "flag": "-T",
                    "long": "--sticky-timeouts"
                },
                {
                    "name": "-X --read-implies-exec",
                    "content": "If this is set then mmap(3p) PROTREAD will also add the PROTEXEC bit - as expected by\nlegacy x86 binaries. Notice that the ELF loader will automatically set this bit when it\nencounters a legacy binary. Turns on READIMPLIESEXEC.\n",
                    "flag": "-X",
                    "long": "--read-implies-exec"
                },
                {
                    "name": "-Z --mmap-page-zero",
                    "content": "SVr4 bug emulation that will set mmap(3p) page zero as read-only. Use when program\ndepends on this behavior, and the source code is not available to be fixed. Turns on\nMMAPPAGEZERO.\n",
                    "flag": "-Z",
                    "long": "--mmap-page-zero"
                },
                {
                    "name": "-V --version",
                    "content": "Display version information and exit.\n",
                    "flag": "-V",
                    "long": "--version"
                },
                {
                    "name": "-h --help",
                    "content": "Display help text and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                }
            ]
        },
        "EXAMPLE": {
            "content": "setarch --addr-no-randomize mytestprog\nsetarch ppc32 rpmbuild --target=ppc --rebuild foo.src.rpm\nsetarch ppc32 -v -vL3 rpmbuild --target=ppc --rebuild bar.src.rpm\nsetarch ppc32 --32bit rpmbuild --target=ppc --rebuild foo.src.rpm\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Elliot Lee <sopwith@redhat.com>, Jindrich Novy <jnovy@redhat.com>, Karel Zak\n<kzak@redhat.com>\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "personality(2), select(2)\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "For bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.\n",
            "subsections": []
        },
        "AVAILABILITY": {
            "content": "The setarch command is part of the util-linux package which can be downloaded from Linux\nKernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\n\n\nutil-linux 2.37.2                            2021-07-20                                   SETARCH(8)",
            "subsections": []
        }
    },
    "summary": "setarch - change reported architecture in new program environment and/or set personality flags",
    "flags": [
        {
            "flag": "",
            "long": "--list",
            "arg": null,
            "description": "List the architectures that setarch knows about. Whether setarch can actually set each of these architectures depends on the running kernel."
        },
        {
            "flag": "",
            "long": "--uname-2.6",
            "arg": null,
            "description": "Causes the program to see a kernel version number beginning with 2.6. Turns on UNAME26."
        },
        {
            "flag": "-v",
            "long": "--verbose",
            "arg": null,
            "description": "Be verbose."
        },
        {
            "flag": "-3",
            "long": "--3gb",
            "arg": null,
            "description": "Specifies program should use a maximum of 3GB of address space. Supported on x86. Turns on ADDRLIMIT3GB."
        },
        {
            "flag": "",
            "long": "--4gb",
            "arg": null,
            "description": "This option has no effect. It is retained for backward compatibility only, and may be removed in future releases."
        },
        {
            "flag": "-B",
            "long": "--32bit",
            "arg": null,
            "description": "Limit the address space to 32 bits to emulate hardware. Supported on ARM and Alpha. Turns on ADDRLIMIT32BIT."
        },
        {
            "flag": "-F",
            "long": "--fdpic-funcptrs",
            "arg": null,
            "description": "Treat user-space function pointers to signal handlers as pointers to address descriptors. This option has no effect on architectures that do not support FDPIC ELF binaries. In kernel v4.14 support is limited to ARM, Blackfin, Fujitsu FR-V, and SuperH CPU architectures."
        },
        {
            "flag": "-I",
            "long": "--short-inode",
            "arg": null,
            "description": "Obsolete bug emulation flag. Turns on SHORTINODE."
        },
        {
            "flag": "-L",
            "long": "--addr-compat-layout",
            "arg": null,
            "description": "Provide legacy virtual address space layout. Use when the program binary does not have PTGNUSTACK ELF header. Turns on ADDRCOMPATLAYOUT."
        },
        {
            "flag": "-R",
            "long": "--addr-no-randomize",
            "arg": null,
            "description": "Disables randomization of the virtual address space. Turns on ADDRNORANDOMIZE."
        },
        {
            "flag": "-S",
            "long": "--whole-seconds",
            "arg": null,
            "description": "Obsolete bug emulation flag. Turns on WHOLESECONDS."
        },
        {
            "flag": "-T",
            "long": "--sticky-timeouts",
            "arg": null,
            "description": "This makes select(2), pselect(2), and ppoll(2) system calls preserve the timeout value instead of modifying it to reflect the amount of time not slept when interrupted by a signal handler. Use when program depends on this behavior. For more details see the timeout description in select(2) manual page. Turns on STICKYTIMEOUTS."
        },
        {
            "flag": "-X",
            "long": "--read-implies-exec",
            "arg": null,
            "description": "If this is set then mmap(3p) PROTREAD will also add the PROTEXEC bit - as expected by legacy x86 binaries. Notice that the ELF loader will automatically set this bit when it encounters a legacy binary. Turns on READIMPLIESEXEC."
        },
        {
            "flag": "-Z",
            "long": "--mmap-page-zero",
            "arg": null,
            "description": "SVr4 bug emulation that will set mmap(3p) page zero as read-only. Use when program depends on this behavior, and the source code is not available to be fixed. Turns on MMAPPAGEZERO."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "Display version information and exit."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Display help text and exit."
        }
    ],
    "examples": [
        "setarch --addr-no-randomize mytestprog",
        "setarch ppc32 rpmbuild --target=ppc --rebuild foo.src.rpm",
        "setarch ppc32 -v -vL3 rpmbuild --target=ppc --rebuild bar.src.rpm",
        "setarch ppc32 --32bit rpmbuild --target=ppc --rebuild foo.src.rpm"
    ],
    "see_also": [
        {
            "name": "personality",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/personality/2/json"
        },
        {
            "name": "select",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/select/2/json"
        }
    ]
}