tgkill on x64
send a signal to a thread
sys_tgkill(pid_t tgid, pid_t pid, int sig)
| number | 234 (0xea) |
|---|---|
| abi | common |
| entry point | sys_tgkill |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | tgkill(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 234, the syscall number |
rdi | pid_t tgid |
rsi | pid_t pid |
rdx | 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 270
- arm64 131
- arm 268
- riscv64 131
- ia32 270
- x32 1073742058
- loongarch64 131
- ppc64 250
- ppc 250
- s390x 241
- mips64 5225
- mipsn32 6229
- mipso32 4266
- alpha 424
- arc 131
- blackfin 271, removed in 4.17
- cris 270, removed in 4.17
- csky 131
- frv 270, removed in 4.17
- hexagon 131
- ia64 1235, removed in 6.7
- m32r 270, removed in 4.17
- m68k 265
- metag 131, removed in 4.17
- microblaze 270
- mn10300 270, removed in 4.17
- nds32 131, removed in 5.18
- nios2 131
- openrisc 131
- parisc 259
- score 131, removed in 4.17
- sh 270
- sparc 211
- sparc64 211
- tilegx 131, removed in 4.17
- tilepro 131, removed in 4.17
- xtensa 125
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/tgkill