summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common/linux_exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/linux/common/linux_exec.c')
-rw-r--r--sys/compat/linux/common/linux_exec.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/sys/compat/linux/common/linux_exec.c b/sys/compat/linux/common/linux_exec.c
index 7c4a9223314..b2865d430e2 100644
--- a/sys/compat/linux/common/linux_exec.c
+++ b/sys/compat/linux/common/linux_exec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec.c,v 1.122 2020/04/24 03:22:06 thorpej Exp $ */
+/* $NetBSD: linux_exec.c,v 1.123 2020/04/26 18:53:33 thorpej Exp $ */
/*-
* Copyright (c) 1994, 1995, 1998, 2000, 2007, 2008, 2020
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.122 2020/04/24 03:22:06 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.123 2020/04/26 18:53:33 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -44,6 +44,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.122 2020/04/24 03:22:06 thorpej Exp
#include <sys/mount.h>
#include <sys/exec.h>
#include <sys/exec_elf.h>
+#include <sys/futex.h>
#include <sys/mman.h>
#include <sys/syscallargs.h>
@@ -61,7 +62,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.122 2020/04/24 03:22:06 thorpej Exp
#include <compat/linux/common/linux_sched.h>
#include <compat/linux/common/linux_machdep.h>
#include <compat/linux/common/linux_exec.h>
-#include <compat/linux/common/linux_futex.h>
#include <compat/linux/common/linux_ipc.h>
#include <compat/linux/common/linux_sem.h>
@@ -168,32 +168,24 @@ void
linux_e_lwp_exit(struct lwp *l)
{
struct linux_emuldata *led;
- struct linux_sys_futex_args cup;
register_t retval;
int error, zero = 0;
led = l->l_emuldata;
- if (led->led_clear_tid == NULL) {
- return;
- }
- /* Emulate LINUX_CLONE_CHILD_CLEARTID */
- error = copyout(&zero, led->led_clear_tid, sizeof(zero));
+ if (led->led_clear_tid != NULL) {
+ /* Emulate LINUX_CLONE_CHILD_CLEARTID */
+ error = copyout(&zero, led->led_clear_tid, sizeof(zero));
#ifdef DEBUG_LINUX
- if (error != 0)
- printf("%s: cannot clear TID\n", __func__);
+ if (error != 0)
+ printf("%s: cannot clear TID\n", __func__);
#endif
- SCARG(&cup, uaddr) = led->led_clear_tid;
- SCARG(&cup, op) = LINUX_FUTEX_WAKE;
- SCARG(&cup, val) = 0x7fffffff; /* Awake everyone */
- SCARG(&cup, timeout) = NULL;
- SCARG(&cup, uaddr2) = NULL;
- SCARG(&cup, val3) = 0;
- if ((error = linux_sys_futex(curlwp, &cup, &retval)) != 0)
- printf("%s: linux_sys_futex failed\n", __func__);
-
- release_futexes(l);
+ error = do_futex((int *)led->led_clear_tid, FUTEX_WAKE,
+ INT_MAX, NULL, NULL, 0, 0, &retval);
+ if (error)
+ printf("%s: linux_sys_futex failed\n", __func__);
+ }
led = l->l_emuldata;
l->l_emuldata = NULL;