diff options
author | Nikolay Sturm <sturm@cvs.openbsd.org> | 2007-05-29 10:44:30 +0000 |
---|---|---|
committer | Nikolay Sturm <sturm@cvs.openbsd.org> | 2007-05-29 10:44:30 +0000 |
commit | 3f49387707bb221fd1ff64b8bb73f0a5d9cec1ae (patch) | |
tree | 13f40525a9a73c9743c2644f6d4d162a35bea5f3 /sys/compat/linux | |
parent | 4a1ae4443ccb43035e4e4135b588552441238ecc (diff) |
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')
-rw-r--r-- | sys/compat/linux/linux_ipc.c | 6 |
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); } |