From e7609e6478a135a0520880b7e7e342df010c3d3f Mon Sep 17 00:00:00 2001 From: manu Date: Fri, 4 Nov 2005 16:54:11 +0000 Subject: Implement Linux futex ang gettid --- sys/compat/linux/common/linux_exec.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'sys/compat/linux/common/linux_exec.c') diff --git a/sys/compat/linux/common/linux_exec.c b/sys/compat/linux/common/linux_exec.c index 67892d02dc1..d55ea201b49 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.77 2005/06/22 15:10:51 manu Exp $ */ +/* $NetBSD: linux_exec.c,v 1.78 2005/11/04 16:54:11 manu Exp $ */ /*- * Copyright (c) 1994, 1995, 1998, 2000 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.77 2005/06/22 15:10:51 manu Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.78 2005/11/04 16:54:11 manu Exp $"); #include #include @@ -65,6 +65,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.77 2005/06/22 15:10:51 manu Exp $") #include #include #include +#include #include #include @@ -261,17 +262,24 @@ linux_e_proc_exit(p) if (e->clear_tid != NULL) { int error; int null = 0; + struct linux_sys_futex_args cup; + register_t retval; + struct lwp *l; if ((error = copyout(&null, e->clear_tid, sizeof(null))) != 0) printf("linux_e_proc_exit: cannot clear TID\n"); -#ifdef notyet /* Not yet implemented */ - if ((error = linux_sys_futex(e->clear_tid, - LINUX_FUTEX_WAKE, 1, NULL, NULL, 0)) != 0) + l = proc_representative_lwp(p); + SCARG(&cup, uaddr) = e->clear_tid; + SCARG(&cup, op) = LINUX_FUTEX_WAKE; + SCARG(&cup, val) = 0; + SCARG(&cup, timeout) = NULL; + SCARG(&cup, uaddr2) = NULL; + SCARG(&cup, val3) = 0; + if ((error = linux_sys_futex(l, &cup, &retval)) != 0) printf("linux_e_proc_exit: linux_sys_futex failed\n"); -#endif } /* free Linux emuldata and set the pointer to null */ -- cgit