summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
dbfb508)
SCCS-vsn: sys/kern/sysv_shm.c 7.7
*
* from: Utah $Hdr: uipc_shm.c 1.9 89/08/14$
*
*
* from: Utah $Hdr: uipc_shm.c 1.9 89/08/14$
*
- * @(#)sysv_shm.c 7.6 (Berkeley) %G%
+ * @(#)sysv_shm.c 7.7 (Berkeley) %G%
/* XXX: probably not the right thing to do */
if (shp->shm_perm.mode & SHM_DEST)
return (EBUSY);
/* XXX: probably not the right thing to do */
if (shp->shm_perm.mode & SHM_DEST)
return (EBUSY);
- if (error = ipcaccess(cred, &shp->shm_perm, uap->shmflg&0777))
+ if (error = ipcaccess(&shp->shm_perm, uap->shmflg&0777, cred))
return (error);
if (uap->size && uap->size > shp->shm_segsz)
return (EINVAL);
return (error);
if (uap->size && uap->size > shp->shm_segsz)
return (EINVAL);
return (EEXIST);
}
*retval = shp->shm_perm.seq * SHMMMNI + rval;
return (EEXIST);
}
*retval = shp->shm_perm.seq * SHMMMNI + rval;
shp = &shmsegs[uap->shmid % SHMMMNI];
switch (uap->cmd) {
case IPC_STAT:
shp = &shmsegs[uap->shmid % SHMMMNI];
switch (uap->cmd) {
case IPC_STAT:
- if (error = ipcaccess(cred, &shp->shm_perm, IPC_R))
+ if (error = ipcaccess(&shp->shm_perm, IPC_R, cred))
return (error);
return (copyout((caddr_t)shp, uap->buf, sizeof(*shp)));
return (error);
return (copyout((caddr_t)shp, uap->buf, sizeof(*shp)));
register int size;
struct mapmem *mp;
caddr_t uva;
register int size;
struct mapmem *mp;
caddr_t uva;
- int error, error1, prot, shmmapin();
+ int error, prot, shmmapin();
if (error = shmvalid(uap->shmid))
return (error);
shp = &shmsegs[uap->shmid % SHMMMNI];
if (shp->shm_handle == NULL)
panic("shmat NULL handle");
if (error = shmvalid(uap->shmid))
return (error);
shp = &shmsegs[uap->shmid % SHMMMNI];
if (shp->shm_handle == NULL)
panic("shmat NULL handle");
- if (error = ipcaccess(u.u_cred, &shp->shm_perm,
- (uap->shmflg&SHM_RDONLY) ? IPC_R : IPC_R|IPC_W))
+ if (error = ipcaccess(&shp->shm_perm,
+ (uap->shmflg&SHM_RDONLY) ? IPC_R : IPC_R|IPC_W, u.u_cred))
return (error);
uva = uap->shmaddr;
if (uva && ((int)uva & (SHMLBA-1))) {
return (error);
uva = uap->shmaddr;
if (uva && ((int)uva & (SHMLBA-1))) {
if (error)
return (error);
if (error = mmmapin(p, mp, shmmapin)) {
if (error)
return (error);
if (error = mmmapin(p, mp, shmmapin)) {
- if (error1 = mmfree(p, mp))
- return (error1);
shp->shm_atime = time.tv_sec;
shp->shm_nattch++;
*retval = (int) uva;
shp->shm_atime = time.tv_sec;
shp->shm_nattch++;
*retval = (int) uva;
/*
* Detach from shared memory segment on exit (or exec)
*/
/*
* Detach from shared memory segment on exit (or exec)
*/
-shmexit(p, mp)
- struct proc *p;
+ struct proc *p = u.u_procp; /* XXX */
return (shmufree(p, mp));
}
return (shmufree(p, mp));
}