io_setup on x64
create an asynchronous I/O context
sys_io_setup(unsigned nr_events, aio_context_t *ctxp)
| number | 206 (0xce) |
|---|---|
| abi | 64 |
| kconfig | CONFIG_AIO |
| family | aio see the whole family on x64 |
| entry point | sys_io_setup |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | io_setup(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 206, the syscall number |
rdi | unsigned nr_events |
rsi | aio_context_t *ctxp |
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 245
- arm64 0
- arm 243
- riscv64 0
- ia32 245
- x32 1073742030, 1073742367
- loongarch64 0
- ppc64 227
- ppc 227
- s390x 243
- mips64 5200
- mipsn32 6200
- mipso32 4241
- alpha 398
- arc 0
- blackfin 245, removed in 4.17
- cris 245, removed in 4.17
- csky 0
- frv 245, removed in 4.17
- hexagon 0
- ia64 1238, removed in 6.7
- m32r 245, removed in 4.17
- m68k 241
- metag 0, removed in 4.17
- microblaze 245
- mn10300 245, removed in 4.17
- nds32 0, removed in 5.18
- nios2 0
- openrisc 0
- parisc 215
- score 0, removed in 4.17
- sh 245
- sparc 268
- sparc64 268
- tilegx 0, removed in 4.17
- tilepro 0, removed in 4.17
- xtensa 239
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/io_setup