unshare on x64
disassociate parts of the process execution context
sys_unshare(unsigned long unshare_flags)
| number | 272 (0x110) |
|---|---|
| abi | common |
| entry point | sys_unshare |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | unshare(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 272, the syscall number |
rdi | unsigned long unshare_flags |
rax | the return value |
Then run syscall to enter the kernel.
The syscall instruction clobbers rcx (the return address lands in rcx) and r11 (the flags land in r11).
Since Linux 5.14 the kernel reads the syscall number from eax and ignores the upper 32 bits of rax. Older kernels fail with ENOSYS when those bits are not zero, and mov eax, N clears them, so it works on both.
Same syscall on other architectures
- x86 310
- arm64 97
- arm 337
- riscv64 97
- ia32 310
- x32 1073742096
- loongarch64 97
- ppc64 282
- ppc 282
- s390x 303
- mips64 5262
- mipsn32 6266
- mipso32 4303
- alpha 465
- arc 97
- blackfin 310, removed in 4.17
- cris 310, removed in 4.17
- csky 97
- frv 310, removed in 4.17
- hexagon 97
- ia64 1296, removed in 6.7
- m32r 310, removed in 4.17
- m68k 303
- metag 97, removed in 4.17
- microblaze 310
- mn10300 311, removed in 4.17
- nds32 97, removed in 5.18
- nios2 97
- openrisc 97
- parisc 288
- score 97, removed in 4.17
- sh 310
- sparc 299
- sparc64 299
- tilegx 97, removed in 4.17
- tilepro 97, removed in 4.17
- xtensa 266
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/unshare