geteuid on x64
get user identity
sys_geteuid(void)
| number | 107 (0x6b) |
|---|---|
| abi | common |
| entry point | sys_geteuid |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | geteuid(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 107, 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 49
- arm64 175
- arm 49
- riscv64 175
- ia32 49
- x32 1073741931
- loongarch64 175
- ppc64 49
- ppc 49
- s390x 201
- mips64 5105
- mipsn32 6105
- mipso32 4049
- alpha 531
- arc 175
- blackfin 49, removed in 4.17
- cris 49, removed in 4.17
- csky 175
- frv 49, removed in 4.17
- hexagon 175
- ia64 1047, removed in 6.7
- m68k 49
- metag 175, removed in 4.17
- microblaze 49
- mn10300 49, removed in 4.17
- nds32 175, removed in 5.18
- nios2 175
- openrisc 175
- parisc 49
- score 175, removed in 4.17
- sh 49
- sparc 49
- sparc64 49
- tilegx 175, removed in 4.17
- tilepro 175, removed in 4.17
- xtensa 140
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/geteuid