getresuid on x64
get real, effective, and saved user/group IDs
sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid)
| number | 118 (0x76) |
|---|---|
| abi | common |
| entry point | sys_getresuid |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | getresuid(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 118, the syscall number |
rdi | uid_t *ruid |
rsi | uid_t *euid |
rdx | uid_t *suid |
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 165
- arm64 148
- arm 165
- riscv64 148
- ia32 165
- x32 1073741942
- loongarch64 148
- ppc64 165
- ppc 165
- s390x 209
- mips64 5116
- mipsn32 6116
- mipso32 4186
- alpha 344
- arc 148
- blackfin 165, removed in 4.17
- cris 165, removed in 4.17
- csky 148
- frv 165, removed in 4.17
- hexagon 148
- ia64 1073, removed in 6.7
- m68k 165
- metag 148, removed in 4.17
- microblaze 165
- mn10300 165, removed in 4.17
- nds32 148, removed in 5.18
- nios2 148
- openrisc 148
- parisc 165
- score 148, removed in 4.17
- sh 165
- sparc64 109
- tilegx 148, removed in 4.17
- tilepro 148, removed in 4.17
- xtensa 145
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/getresuid