getresgid on x64
get real, effective, and saved user/group IDs
sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid)
| number | 120 (0x78) |
|---|---|
| abi | common |
| entry point | sys_getresgid |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | getresgid(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 120, the syscall number |
rdi | gid_t *rgid |
rsi | gid_t *egid |
rdx | gid_t *sgid |
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 171
- arm64 150
- arm 171
- riscv64 150
- ia32 171
- x32 1073741944
- loongarch64 150
- ppc64 170
- ppc 170
- s390x 211
- mips64 5118
- mipsn32 6118
- mipso32 4191
- alpha 372
- arc 150
- blackfin 171, removed in 4.17
- cris 171, removed in 4.17
- csky 150
- frv 171, removed in 4.17
- hexagon 150
- ia64 1075, removed in 6.7
- m68k 171
- metag 150, removed in 4.17
- microblaze 171
- mn10300 171, removed in 4.17
- nds32 150, removed in 5.18
- nios2 150
- openrisc 150
- parisc 171
- score 150, removed in 4.17
- sh 171
- sparc64 111
- tilegx 150, removed in 4.17
- tilepro 150, removed in 4.17
- xtensa 147
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/getresgid