summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPaul Irofti <pirofti@cvs.openbsd.org>2012-06-19 11:35:30 +0000
committerPaul Irofti <pirofti@cvs.openbsd.org>2012-06-19 11:35:30 +0000
commit8f4d76850854f003f42b98f876ab47a93bf932bc (patch)
tree2f474810a93da90c834d0ebaf6cccf096f9496f9 /sys
parentd6a303e6bdda7672c38f44cead047ec085ee7569 (diff)
Implement linux_sys_tgkill.
Nobody calls linux_sys_tkill anymore so code for that is not needed. If this will become an issue in the future a simple wrapper will fix that. Okay jasper@.
Diffstat (limited to 'sys')
-rw-r--r--sys/compat/linux/linux_signal.c27
-rw-r--r--sys/compat/linux/syscalls.master4
2 files changed, 28 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c
index a3de140578c..67af421caef 100644
--- a/sys/compat/linux/linux_signal.c
+++ b/sys/compat/linux/linux_signal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_signal.c,v 1.14 2009/12/09 16:29:56 jsg Exp $ */
+/* $OpenBSD: linux_signal.c,v 1.15 2012/06/19 11:35:29 pirofti Exp $ */
/* $NetBSD: linux_signal.c,v 1.10 1996/04/04 23:51:36 christos Exp $ */
/*
@@ -919,3 +919,28 @@ linux_sys_kill(p, v, retval)
SCARG(&ka, signum) = linux_to_bsd_sig[SCARG(uap, signum)];
return (sys_kill(p, &ka, retval));
}
+
+int
+linux_sys_tgkill(struct proc *p, void *v, register_t *retval)
+{
+ struct linux_sys_tgkill_args /* {
+ syscallarg(int) tgid;
+ syscallarg(int) tid;
+ syscallarg(int) sig;
+ }; */ *uap = v;
+
+ int error;
+ int sig;
+ struct sys_kill_args ka;
+
+ if (SCARG(uap, tgid) < 0 || SCARG(uap, tid) < 0)
+ return (EINVAL);
+
+ if ((error = linux_to_bsd_signal(SCARG(uap, sig), &sig)))
+ return (error);
+
+ /* XXX: Ignoring tgid, behaving like the obsolete linux_sys_tkill */
+ SCARG(&ka, pid) = SCARG(uap, tid);
+ SCARG(&ka, signum) = sig;
+ return (sys_kill(p, &ka, retval));
+}
diff --git a/sys/compat/linux/syscalls.master b/sys/compat/linux/syscalls.master
index 9e190a7d365..b80bd9c9cf5 100644
--- a/sys/compat/linux/syscalls.master
+++ b/sys/compat/linux/syscalls.master
@@ -1,4 +1,4 @@
- $OpenBSD: syscalls.master,v 1.70 2012/06/19 11:31:39 pirofti Exp $
+ $OpenBSD: syscalls.master,v 1.71 2012/06/19 11:35:29 pirofti Exp $
; $NetBSD: syscalls.master,v 1.15 1995/12/18 14:35:10 fvdl Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -420,7 +420,7 @@
struct linux_statfs64 *sp); }
269 STD { int linux_sys_fstatfs64(int fd, \
struct linux_statfs64 *sp); }
-270 UNIMPL linux_sys_tgkill
+270 STD { int linux_sys_tgkill(int tgid, int tid, int sig); }
271 UNIMPL linux_sys_utimes
272 UNIMPL linux_sys_fadvise64_64
273 UNIMPL linux_sys_vserver