summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_exec.c
diff options
context:
space:
mode:
authorpirofti <pirofti@openbsd.org>2011-09-18 02:23:18 +0000
committerpirofti <pirofti@openbsd.org>2011-09-18 02:23:18 +0000
commitad0738f2c45ee605ec7410d904416edd0af4d9be (patch)
tree45c92c4e612ee415e436d5a4c34099e31837a1c6 /sys/compat/linux/linux_exec.c
parentMake sysctl__string() handle the truncated output case via two (diff)
downloadwireguard-openbsd-ad0738f2c45ee605ec7410d904416edd0af4d9be.tar.xz
wireguard-openbsd-ad0738f2c45ee605ec7410d904416edd0af4d9be.zip
Add futex support for compat/linux.
Based on Emmanuel Dreyfus work with additions, tricks and adaptations by me. Lots of help and reviewing by guenther@ and oga@. Okay guenther@.
Diffstat (limited to 'sys/compat/linux/linux_exec.c')
-rw-r--r--sys/compat/linux/linux_exec.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_exec.c b/sys/compat/linux/linux_exec.c
index 121dc1634ea..4673f2fb7b0 100644
--- a/sys/compat/linux/linux_exec.c
+++ b/sys/compat/linux/linux_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_exec.c,v 1.34 2011/04/20 19:14:34 pirofti Exp $ */
+/* $OpenBSD: linux_exec.c,v 1.35 2011/09/18 02:23:18 pirofti Exp $ */
/* $NetBSD: linux_exec.c,v 1.13 1996/04/05 00:01:10 christos Exp $ */
/*-
@@ -77,6 +77,9 @@ extern struct sysent linux_sysent[];
extern char *linux_syscallnames[];
#endif
+extern struct mutex futex_lock;
+extern void futex_pool_init(void);
+
int exec_linux_aout_prep_zmagic(struct proc *, struct exec_package *);
int exec_linux_aout_prep_nmagic(struct proc *, struct exec_package *);
int exec_linux_aout_prep_omagic(struct proc *, struct exec_package *);
@@ -463,6 +466,7 @@ exec_linux_elf32_makecmds(struct proc *p, struct exec_package *epp)
{
if (!(emul_linux_elf.e_flags & EMUL_ENABLED))
return (ENOEXEC);
+
return exec_elf32_makecmds(p, epp);
}
@@ -510,6 +514,10 @@ recognized:
*pos = ELF32_NO_ADDR;
if (*os == OOS_NULL)
*os = OOS_LINUX;
+
+ mtx_init(&futex_lock, IPL_NONE);
+ futex_pool_init();
+
return (0);
}