setdomainname on x64
get/set NIS domain name
sys_setdomainname(char *name, int len)
| number | 171 (0xab) |
|---|---|
| abi | common |
| entry point | sys_setdomainname |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | setdomainname(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 171, the syscall number |
rdi | char *name |
rsi | int len |
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 121
- arm64 162
- arm 121
- riscv64 162
- ia32 121
- x32 1073741995
- loongarch64 162
- ppc64 121
- ppc 121
- s390x 121
- mips64 5166
- mipsn32 6166
- mipso32 4121
- alpha 166
- arc 162
- blackfin 121, removed in 4.17
- cris 121, removed in 4.17
- csky 162
- frv 121, removed in 4.17
- hexagon 162
- ia64 1129, removed in 6.7
- m32r 121, removed in 4.17
- m68k 121
- metag 162, removed in 4.17
- microblaze 121
- mn10300 121, removed in 4.17
- nds32 162, removed in 5.18
- nios2 162
- openrisc 162
- parisc 121
- score 162, removed in 4.17
- sh 121
- sparc 163
- sparc64 163
- tilegx 162, removed in 4.17
- tilepro 162, removed in 4.17
- xtensa 199
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/setdomainname