{
    "content": [
        {
            "type": "text",
            "text": "# SETARCH(8) (man)\n\n**Summary:** setarch - change reported architecture in new program environment and/or set personality flags\n\n**Synopsis:** setarch [arch] [options] [program [argument...]]\nsetarch --list|-h|-V\narch [options] [program [argument...]]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| — | --list | — | List the architectures that setarch knows about. Whether setarch can actually set each of these architectures depends on |\n| — | --uname-2.6 | — | Causes the program to see a kernel version number beginning with 2.6. Turns on UNAME26. |\n| -v | --verbose | — | Be verbose. |\n| -3 | --3gb | — | Specifies program should use a maximum of 3GB of address space. Supported on x86. Turns on ADDRLIMIT3GB. |\n| — | --4gb | — | This option has no effect. It is retained for backward compatibility only, and may be removed in future releases. |\n| -B | --32bit | — | Limit the address space to 32 bits to emulate hardware. Supported on ARM and Alpha. Turns on ADDRLIMIT32BIT. |\n| -F | --fdpic-funcptrs | — | Treat user-space function pointers to signal handlers as pointers to address descriptors. This option has no effect on a |\n| -I | --short-inode | — | Obsolete bug emulation flag. Turns on SHORTINODE. |\n| -L | --addr-compat-layout | — | Provide legacy virtual address space layout. Use when the program binary does not have PTGNUSTACK ELF header. Turns on A |\n| -R | --addr-no-randomize | — | Disables randomization of the virtual address space. Turns on ADDRNORANDOMIZE. |\n| -S | --whole-seconds | — | Obsolete bug emulation flag. Turns on WHOLESECONDS. |\n| -T | --sticky-timeouts | — | This makes select(2), pselect(2), and ppoll(2) system calls preserve the timeout value instead of modifying it to reflec |\n| -X | --read-implies-exec | — | If this is set then mmap(3p) PROTREAD will also add the PROTEXEC bit - as expected by legacy x86 binaries. Notice that t |\n| -Z | --mmap-page-zero | — | SVr4 bug emulation that will set mmap(3p) page zero as read-only. Use when program depends on this behavior, and the sou |\n| -V | --version | — | Display version information and exit. |\n| -h | --help | — | Display help text and exit. |\n\n## Examples\n\n- `setarch --addr-no-randomize mytestprog`\n- `setarch ppc32 rpmbuild --target=ppc --rebuild foo.src.rpm`\n- `setarch ppc32 -v -vL3 rpmbuild --target=ppc --rebuild bar.src.rpm`\n- `setarch ppc32 --32bit rpmbuild --target=ppc --rebuild foo.src.rpm`\n\n## See Also\n\n- personality(2)\n- select(2)\n\n## Section Outline\n\n- **NAME** (3 lines)\n- **SYNOPSIS** (6 lines)\n- **DESCRIPTION** (11 lines)\n- **OPTIONS** (1 lines) — 16 subsections\n  - --list (3 lines)\n  - --uname-2.6 (2 lines)\n  - -v --verbose (2 lines)\n  - -3 --3gb (3 lines)\n  - --4gb (3 lines)\n  - -B --32bit (3 lines)\n  - -F --fdpic-funcptrs (5 lines)\n  - -I --short-inode (2 lines)\n  - -L --addr-compat-layout (3 lines)\n  - -R --addr-no-randomize (2 lines)\n  - -S --whole-seconds (2 lines)\n  - -T --sticky-timeouts (5 lines)\n  - -X --read-implies-exec (4 lines)\n  - -Z --mmap-page-zero (4 lines)\n  - -V --version (2 lines)\n  - -h --help (2 lines)\n- **EXAMPLE** (5 lines)\n- **AUTHORS** (3 lines)\n- **SEE ALSO** (2 lines)\n- **REPORTING BUGS** (2 lines)\n- **AVAILABILITY** (6 lines)\n\n## Full Content\n\n### NAME\n\nsetarch - change reported architecture in new program environment and/or set personality\nflags\n\n### SYNOPSIS\n\nsetarch [arch] [options] [program [argument...]]\n\nsetarch --list|-h|-V\n\narch [options] [program [argument...]]\n\n### DESCRIPTION\n\nsetarch 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\n### OPTIONS\n\n#### --list\n\nList the architectures that setarch knows about. Whether setarch can actually set each of\nthese architectures depends on the running kernel.\n\n#### --uname-2.6\n\nCauses the program to see a kernel version number beginning with 2.6. Turns on UNAME26.\n\n#### -v --verbose\n\nBe verbose.\n\n#### -3 --3gb\n\nSpecifies program should use a maximum of 3GB of address space. Supported on x86. Turns\non ADDRLIMIT3GB.\n\n#### --4gb\n\nThis option has no effect. It is retained for backward compatibility only, and may be\nremoved in future releases.\n\n#### -B --32bit\n\nLimit the address space to 32 bits to emulate hardware. Supported on ARM and Alpha. Turns\non ADDRLIMIT32BIT.\n\n#### -F --fdpic-funcptrs\n\nTreat 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\n#### -I --short-inode\n\nObsolete bug emulation flag. Turns on SHORTINODE.\n\n#### -L --addr-compat-layout\n\nProvide legacy virtual address space layout. Use when the program binary does not have\nPTGNUSTACK ELF header. Turns on ADDRCOMPATLAYOUT.\n\n#### -R --addr-no-randomize\n\nDisables randomization of the virtual address space. Turns on ADDRNORANDOMIZE.\n\n#### -S --whole-seconds\n\nObsolete bug emulation flag. Turns on WHOLESECONDS.\n\n#### -T --sticky-timeouts\n\nThis 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\n#### -X --read-implies-exec\n\nIf 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\n#### -Z --mmap-page-zero\n\nSVr4 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\n#### -V --version\n\nDisplay version information and exit.\n\n#### -h --help\n\nDisplay help text and exit.\n\n### EXAMPLE\n\nsetarch --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\n### AUTHORS\n\nElliot Lee <sopwith@redhat.com>, Jindrich Novy <jnovy@redhat.com>, Karel Zak\n<kzak@redhat.com>\n\n### SEE ALSO\n\npersonality(2), select(2)\n\n### REPORTING BUGS\n\nFor bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.\n\n### AVAILABILITY\n\nThe 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)\n\n"
        }
    ],
    "structuredContent": {
        "command": "SETARCH",
        "section": "8",
        "mode": "man",
        "summary": "setarch - change reported architecture in new program environment and/or set personality flags",
        "synopsis": "setarch [arch] [options] [program [argument...]]\nsetarch --list|-h|-V\narch [options] [program [argument...]]",
        "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"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "--list",
                        "lines": 3,
                        "long": "--list"
                    },
                    {
                        "name": "--uname-2.6",
                        "lines": 2,
                        "long": "--uname-2.6"
                    },
                    {
                        "name": "-v --verbose",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-3 --3gb",
                        "lines": 3,
                        "flag": "-3",
                        "long": "--3gb"
                    },
                    {
                        "name": "--4gb",
                        "lines": 3,
                        "long": "--4gb"
                    },
                    {
                        "name": "-B --32bit",
                        "lines": 3,
                        "flag": "-B",
                        "long": "--32bit"
                    },
                    {
                        "name": "-F --fdpic-funcptrs",
                        "lines": 5,
                        "flag": "-F",
                        "long": "--fdpic-funcptrs"
                    },
                    {
                        "name": "-I --short-inode",
                        "lines": 2,
                        "flag": "-I",
                        "long": "--short-inode"
                    },
                    {
                        "name": "-L --addr-compat-layout",
                        "lines": 3,
                        "flag": "-L",
                        "long": "--addr-compat-layout"
                    },
                    {
                        "name": "-R --addr-no-randomize",
                        "lines": 2,
                        "flag": "-R",
                        "long": "--addr-no-randomize"
                    },
                    {
                        "name": "-S --whole-seconds",
                        "lines": 2,
                        "flag": "-S",
                        "long": "--whole-seconds"
                    },
                    {
                        "name": "-T --sticky-timeouts",
                        "lines": 5,
                        "flag": "-T",
                        "long": "--sticky-timeouts"
                    },
                    {
                        "name": "-X --read-implies-exec",
                        "lines": 4,
                        "flag": "-X",
                        "long": "--read-implies-exec"
                    },
                    {
                        "name": "-Z --mmap-page-zero",
                        "lines": 4,
                        "flag": "-Z",
                        "long": "--mmap-page-zero"
                    },
                    {
                        "name": "-V --version",
                        "lines": 2,
                        "flag": "-V",
                        "long": "--version"
                    },
                    {
                        "name": "-h --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    }
                ]
            },
            {
                "name": "EXAMPLE",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AVAILABILITY",
                "lines": 6,
                "subsections": []
            }
        ]
    }
}