getgid on x64
get group identity
sys_getgid(void)
| number | 104 (0x68) |
|---|---|
| abi | common |
| entry point | sys_getgid |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | getgid(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 104, the syscall number |
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 47
- arm64 176
- arm 47
- riscv64 176
- ia32 47
- x32 1073741928
- loongarch64 176
- ppc64 47
- ppc 47
- s390x 200
- mips64 5102
- mipsn32 6102
- mipso32 4047
- arc 176
- blackfin 47, removed in 4.17
- cris 47, removed in 4.17
- csky 176
- frv 47, removed in 4.17
- hexagon 176
- ia64 1062, removed in 6.7
- m68k 47
- metag 176, removed in 4.17
- microblaze 47
- mn10300 47, removed in 4.17
- nds32 176, removed in 5.18
- nios2 176
- openrisc 176
- parisc 47
- score 176, removed in 4.17
- sh 47
- sparc 47
- sparc64 47
- tilegx 176, removed in 4.17
- tilepro 176, removed in 4.17
- xtensa 139
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/getgid