summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_ipc.c
diff options
context:
space:
mode:
authorsturm <sturm@openbsd.org>2007-05-29 10:44:28 +0000
committersturm <sturm@openbsd.org>2007-05-29 10:44:28 +0000
commit7658afdc47a065733c998d266380f2d2adccb51a (patch)
tree784e118ff2188926d443ca07c238608a4e717b8c /sys/compat/linux/linux_ipc.c
parentDo not change snaplen when parsing a netflow packet (diff)
downloadwireguard-openbsd-7658afdc47a065733c998d266380f2d2adccb51a.tar.xz
wireguard-openbsd-7658afdc47a065733c998d266380f2d2adccb51a.zip
adapt from netbsd:
fold sys_shmat1() back into sys_shmat(), instead add flag for shmget(2) to specify that later shmat(2) for the shared memory segment should succeed even if the segment would be marked removed; use this to implement the Linux-compatible semantics of shmat(2) this fixes current opera with shm ok millert
Diffstat (limited to 'sys/compat/linux/linux_ipc.c')
-rw-r--r--sys/compat/linux/linux_ipc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c
index 03be16c7dbd..f3a16bb0171 100644
--- a/sys/compat/linux/linux_ipc.c
+++ b/sys/compat/linux/linux_ipc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_ipc.c,v 1.9 2003/10/12 23:44:39 millert Exp $ */
+/* $OpenBSD: linux_ipc.c,v 1.10 2007/05/29 10:44:29 sturm Exp $ */
/* $NetBSD: linux_ipc.c,v 1.10 1996/04/05 00:01:44 christos Exp $ */
/*
@@ -538,7 +538,7 @@ linux_shmat(p, v, retval)
SCARG(&bsa, shmaddr) = SCARG(uap, ptr);
SCARG(&bsa, shmflg) = SCARG(uap, a2);
- if ((error = sys_shmat1(p, &bsa, retval, 1)))
+ if ((error = sys_shmat(p, &bsa, retval)))
return error;
if ((error = copyout(&retval[0], (caddr_t) SCARG(uap, a3),
@@ -595,6 +595,8 @@ linux_shmget(p, v, retval)
SCARG(&bsa, size) = SCARG(uap, a2);
SCARG(&bsa, shmflg) = SCARG(uap, a3);
+ SCARG(&bsa, shmflg) |= _SHM_RMLINGER;
+
return sys_shmget(p, &bsa, retval);
}