Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/sysv_shm.c
Show First 20 Lines • Show All 745 Lines • ▼ Show 20 Lines | if (racct_enable) { | ||||
PROC_LOCK(td->td_proc); | PROC_LOCK(td->td_proc); | ||||
racct_sub(td->td_proc, RACCT_NSHM, 1); | racct_sub(td->td_proc, RACCT_NSHM, 1); | ||||
racct_sub(td->td_proc, RACCT_SHMSIZE, size); | racct_sub(td->td_proc, RACCT_SHMSIZE, size); | ||||
PROC_UNLOCK(td->td_proc); | PROC_UNLOCK(td->td_proc); | ||||
} | } | ||||
#endif | #endif | ||||
return (ENOMEM); | return (ENOMEM); | ||||
} | } | ||||
shm_object->pg_color = 0; | |||||
VM_OBJECT_WLOCK(shm_object); | |||||
vm_object_clear_flag(shm_object, OBJ_ONEMAPPING); | |||||
vm_object_set_flag(shm_object, OBJ_COLORED | OBJ_NOSPLIT); | |||||
VM_OBJECT_WUNLOCK(shm_object); | |||||
shmseg->object = shm_object; | shmseg->object = shm_object; | ||||
shmseg->u.shm_perm.cuid = shmseg->u.shm_perm.uid = cred->cr_uid; | shmseg->u.shm_perm.cuid = shmseg->u.shm_perm.uid = cred->cr_uid; | ||||
shmseg->u.shm_perm.cgid = shmseg->u.shm_perm.gid = cred->cr_gid; | shmseg->u.shm_perm.cgid = shmseg->u.shm_perm.gid = cred->cr_gid; | ||||
shmseg->u.shm_perm.mode = (mode & ACCESSPERMS) | SHMSEG_ALLOCATED; | shmseg->u.shm_perm.mode = (mode & ACCESSPERMS) | SHMSEG_ALLOCATED; | ||||
shmseg->u.shm_perm.key = uap->key; | shmseg->u.shm_perm.key = uap->key; | ||||
shmseg->u.shm_perm.seq = (shmseg->u.shm_perm.seq + 1) & 0x7fff; | shmseg->u.shm_perm.seq = (shmseg->u.shm_perm.seq + 1) & 0x7fff; | ||||
shmseg->cred = crhold(cred); | shmseg->cred = crhold(cred); | ||||
▲ Show 20 Lines • Show All 947 Lines • Show Last 20 Lines |