kill on x64
send signal to a process
sys_kill(pid_t pid, int sig)
| number | 62 (0x3e) |
|---|---|
| abi | common |
| entry point | sys_kill |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | kill(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 62, 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 37
- arm64 129
- arm 37
- riscv64 129
- ia32 37
- x32 1073741886
- loongarch64 129
- ppc64 37
- ppc 37
- s390x 37
- mips64 5060
- mipsn32 6060
- mipso32 4037
- alpha 37
- arc 129
- blackfin 37, removed in 4.17
- cris 37, removed in 4.17
- csky 129
- frv 37, removed in 4.17
- hexagon 129
- ia64 1053, removed in 6.7
- m32r 37, removed in 4.17
- m68k 37
- metag 129, removed in 4.17
- microblaze 37
- mn10300 37, removed in 4.17
- nds32 129, removed in 5.18
- nios2 129
- openrisc 129
- parisc 37
- score 129, removed in 4.17
- sh 37
- sparc 37
- sparc64 37
- tilegx 129, removed in 4.17
- tilepro 129, removed in 4.17
- xtensa 123
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/kill