sysdeps/linux: implement sys_kill
#define NR_execve 59
#define NR_exit 60
#define NR_wait4 61
+#define NR_kill 62
#define NR_fcntl 72
#define NR_unlink 87
#define NR_arch_prctl 158
@@ -356,21 +357,28 @@ int sys_before_cancellable_syscall(ucontext_t *uct) {
return 1;
}
+int sys_tgkill(int tgid, int tid, int sig) {
+ auto ret = do_syscall(NR_tgkill, tgid, tid, sig);
+ if (int e = sc_error(ret); e)
+ return e;
+ return 0;
+}
+
+#endif // __MLIBC_POSIX_OPTION
+
pid_t sys_getpid() {
auto ret = do_syscall(NR_getpid);
// getpid() always succeeds.
return sc_int_result<pid_t>(ret);
}
-int sys_tgkill(int tgid, int tid, int sig) {
- auto ret = do_syscall(NR_tgkill, tgid, tid, sig);
+int sys_kill(int pid, int sig) {
+ auto ret = do_syscall(NR_kill, pid, sig);
if (int e = sc_error(ret); e)
return e;
return 0;
}
-#endif // __MLIBC_POSIX_OPTION
-
int sys_vm_protect(void *pointer, size_t size, int prot) {
auto ret = do_syscall(NR_mprotect, pointer, size, prot);
if (int e = sc_error(ret); e)
