listen on x64
listen for connections on a socket
sys_listen(int fd, int backlog)
| number | 50 (0x32) |
|---|---|
| abi | common |
| entry point | sys_listen |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | listen(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 50, the syscall number |
rdi | int fd |
rsi | int backlog |
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 363
- arm64 201
- arm 284
- riscv64 201
- ia32 363
- x32 1073741874
- loongarch64 201
- ppc64 329
- ppc 329
- s390x 363
- mips64 5049
- mipsn32 6049
- mipso32 4174
- alpha 106
- arc 201
- blackfin 320, removed in 4.17
- csky 201
- hexagon 201
- ia64 1193, removed in 6.7
- m68k 360
- metag 201, removed in 4.17
- microblaze 348
- nds32 201, removed in 5.18
- nios2 201
- openrisc 201
- parisc 32
- score 201, removed in 4.17
- sh 343
- sparc 354
- sparc64 354
- tilegx 201, removed in 4.17
- tilepro 201, removed in 4.17
- xtensa 102
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/listen