X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/blobdiff_plain/a64ba1822e9b19f18714b60b0f5344e86b270981..c7114eea35c253e90b0568995d74ae6f736fc451:/sys/kern/sysv_shm.c diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index c482e27805..9205ae864b 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/kern/sysv_shm.c,v 1.45.2.6 2002/10/22 20:45:03 fjoe Exp $ */ -/* $DragonFly: src/sys/kern/sysv_shm.c,v 1.6 2003/07/24 01:41:25 dillon Exp $ */ +/* $DragonFly: src/sys/kern/sysv_shm.c,v 1.9 2003/07/30 00:19:14 dillon Exp $ */ /* $NetBSD: sysv_shm.c,v 1.23 1994/07/04 23:25:12 glass Exp $ */ /* @@ -311,7 +311,7 @@ shmat(struct shmat_args *uap) shmseg->shm_lpid = p->p_pid; shmseg->shm_atime = time_second; shmseg->shm_nattch++; - p->p_retval[0] = attach_va; + uap->sysmsg_result = attach_va; return 0; } @@ -328,6 +328,7 @@ struct oshmid_ds { }; struct oshmctl_args { + union sysmsg sysmsg; int shmid; int cmd; struct oshmid_ds *ubuf; @@ -465,7 +466,7 @@ shmget_existing(p, uap, mode, segnum) return error; if (uap->size && uap->size > shmseg->shm_segsz) return EINVAL; - p->p_retval[0] = IXSEQ_TO_IPCID(segnum, shmseg->shm_perm); + uap->sysmsg_result = IXSEQ_TO_IPCID(segnum, shmseg->shm_perm); return 0; } @@ -545,7 +546,7 @@ shmget_allocate_segment(p, uap, mode) shmseg->shm_perm.mode &= ~SHMSEG_WANTED; wakeup((caddr_t)shmseg); } - p->p_retval[0] = shmid; + uap->sysmsg_result = shmid; return 0; } @@ -581,13 +582,18 @@ int shmsys(struct shmsys_args *uap) { struct proc *p = curproc; + int which = uap->which; + int error; if (!jail_sysvipc_allowed && p->p_ucred->cr_prison != NULL) return (ENOSYS); - if (uap->which >= sizeof(shmcalls)/sizeof(shmcalls[0])) + if (which >= sizeof(shmcalls)/sizeof(shmcalls[0])) return EINVAL; - return ((*shmcalls[uap->which])(&uap->a2)); + bcopy(&uap->a2, &uap->which, + sizeof(struct shmsys_args) - offsetof(struct shmsys_args, a2)); + error = ((*shmcalls[which])(uap)); + return(error); } void