if (shm_nused >= shminfo.shmmni) /* Any shmids left? */
return (ENOSPC);
size = round_page(uap->size);
- if (shm_committed + btoc(size) > (unsigned long) shminfo.shmall)
+ if (shm_committed + btoc(size) > shminfo.shmall)
return (ENOMEM);
if (shm_last_free < 0) {
shmrealloc(); /* Maybe expand the shmsegs[] array. */
shminit(void)
{
int i;
+ tun_bool_t shm_ar;
TUNABLE_INT_FETCH("kern.ipc.shmmaxpgs", &shminfo.shmall);
for (i = PAGE_SIZE; i > 0; i--) {
TUNABLE_INT_FETCH("kern.ipc.shmmin", &shminfo.shmmin);
TUNABLE_INT_FETCH("kern.ipc.shmmni", &shminfo.shmmni);
TUNABLE_INT_FETCH("kern.ipc.shmseg", &shminfo.shmseg);
- TUNABLE_INT_FETCH("kern.ipc.shm_use_phys", &shm_use_phys);
-
+ TUNABLE_BOOL_FETCH("kern.ipc.shm_allow_removed", &shm_ar);
+ if (shm_ar == TUN_TRUE)
+ shm_allow_removed = 1;
shmalloced = shminfo.shmmni;
shmsegs = (struct shmid_ds *) sys_malloc(shmalloced * sizeof(shmsegs[0]), M_SHM, M_WAITOK);
if (shmsegs == NULL)