io_cancel on x64
cancel an outstanding asynchronous I/O operation
sys_io_cancel(aio_context_t ctx_id, struct iocb *iocb, struct io_event *result)
| number | 210 (0xd2) |
|---|---|
| abi | common |
| kconfig | CONFIG_AIO |
| family | aio see the whole family on x64 |
| entry point | sys_io_cancel |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | io_cancel(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 210, the syscall number |
rdi | aio_context_t ctx_id |
rsi | struct iocb *iocb |
rdx | struct io_event *result |
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 249
- arm64 3
- arm 247
- riscv64 3
- ia32 249
- x32 1073742034
- loongarch64 3
- ppc64 231
- ppc 231
- s390x 247
- mips64 5204
- mipsn32 6204
- mipso32 4245
- alpha 402
- arc 3
- blackfin 249, removed in 4.17
- cris 249, removed in 4.17
- csky 3
- frv 249, removed in 4.17
- hexagon 3
- ia64 1242, removed in 6.7
- m32r 249, removed in 4.17
- m68k 245
- metag 3, removed in 4.17
- microblaze 249
- mn10300 249, removed in 4.17
- nds32 3, removed in 5.18
- nios2 3
- openrisc 3
- parisc 219
- score 3, removed in 4.17
- sh 249
- sparc 271
- sparc64 271
- tilegx 3, removed in 4.17
- tilepro 3, removed in 4.17
- xtensa 243
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/io_cancel