1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <fcntl.h> #include <unistd.h> #include <signal.h> #include <syscall.h> int kill_fd(int fd, int sig) { RC_ERRNO(syscall(SYS_KILL, fd, sig, 0, 0, 0)) } int kill(int pid, int sig) { int fd = open_process(pid); int rc = kill_fd(fd, sig); close(fd); return rc; }