tkill on x64
send a signal to a thread
sys_tkill(pid_t pid, int sig)
| number | 200 (0xc8) |
|---|---|
| abi | common |
| entry point | sys_tkill |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | tkill(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 200, the syscall number |
rdi | pid_t pid |
rsi | int sig |
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 238
- arm64 130
- arm 238
- riscv64 130
- ia32 238
- x32 1073742024
- loongarch64 130
- ppc64 208
- ppc 208
- s390x 237
- mips64 5192
- mipsn32 6192
- mipso32 4236
- alpha 381
- arc 130
- blackfin 238, removed in 4.17
- cris 238, removed in 4.17
- csky 130
- frv 238, removed in 4.17
- hexagon 130
- ia64 1229, removed in 6.7
- m32r 238, removed in 4.17
- m68k 222
- metag 130, removed in 4.17
- microblaze 238
- mn10300 238, removed in 4.17
- nds32 130, removed in 5.18
- nios2 130
- openrisc 130
- parisc 208
- score 130, removed in 4.17
- sh 238
- sparc 187
- sparc64 187
- tilegx 130, removed in 4.17
- tilepro 130, removed in 4.17
- xtensa 124
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/tkill