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 | |
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')
-rw-r--r-- | sys/kern/sysv_shm.c | 23 | ||||
-rw-r--r-- | sys/sys/shm.h | 5 |
2 files changed, 9 insertions, 19 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; diff --git a/sys/sys/shm.h b/sys/sys/shm.h index a3f79d6c0b0..d46cbbed99f 100644 --- a/sys/sys/shm.h +++ b/sys/sys/shm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: shm.h,v 1.28 2018/03/05 01:15:26 deraadt Exp $ */ +/* $OpenBSD: shm.h,v 1.29 2019/11/03 20:16:01 guenther Exp $ */ /* $NetBSD: shm.h,v 1.20 1996/04/09 20:55:35 cgd Exp $ */ /* @@ -136,9 +136,6 @@ void shminit(void); void shmfork(struct vmspace *, struct vmspace *); void shmexit(struct vmspace *); int sysctl_sysvshm(int *, u_int, void *, size_t *, void *, size_t); -int shmctl1(struct proc *, int, int, caddr_t, - int (*)(const void *, void *, size_t), - int (*)(const void *, void *, size_t)); #else /* !_KERNEL */ |