diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2019-11-03 20:16:02 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2019-11-03 20:16:02 +0000 |
commit | ce26d05bcf44d162c55038c2d98f950710df403a (patch) | |
tree | 3a625c33fcecef600a6c78f53f5c6800b533eb33 /sys/kern | |
parent | bf155297cd5af54c7a340ae69f93e06ddfdc195e (diff) |
Merge sys_shmctl() and shmctl1() again, as we no longer have a need for
the copyin/copyout compat shims.
ok deraadt@ millert@ anton@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/sysv_shm.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index c64112f8f72..5215308e1ef 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysv_shm.c,v 1.72 2019/10/28 19:57:50 anton Exp $ */ +/* $OpenBSD: sysv_shm.c,v 1.73 2019/11/03 20:16:01 guenther Exp $ */ /* $NetBSD: sysv_shm.c,v 1.50 1998/10/21 22:24:29 tron Exp $ */ /* @@ -288,19 +288,12 @@ sys_shmctl(struct proc *p, void *v, register_t *retval) syscallarg(int) cmd; syscallarg(struct shmid_ds *) buf; } */ *uap = v; - - return (shmctl1(p, SCARG(uap, shmid), SCARG(uap, cmd), - (caddr_t)SCARG(uap, buf), copyin, copyout)); -} - -int -shmctl1(struct proc *p, int shmid, int cmd, caddr_t buf, - int (*ds_copyin)(const void *, void *, size_t), - int (*ds_copyout)(const void *, void *, size_t)) -{ - struct ucred *cred = p->p_ucred; - struct shmid_ds inbuf, *shmseg; - int error; + int shmid = SCARG(uap, shmid); + int cmd = SCARG(uap, cmd); + void *buf = SCARG(uap, buf); + struct ucred *cred = p->p_ucred; + struct shmid_ds inbuf, *shmseg; + int error; if (cmd == IPC_SET) { error = ds_copyin(buf, &inbuf, sizeof(inbuf)); @@ -315,7 +308,7 @@ shmctl1(struct proc *p, int shmid, int cmd, caddr_t buf, case IPC_STAT: if ((error = ipcperm(cred, &shmseg->shm_perm, IPC_R)) != 0) return (error); - error = ds_copyout(shmseg, buf, sizeof(inbuf)); + error = copyout(shmseg, buf, sizeof(inbuf)); if (error) return (error); break; |