Lines Matching refs:sema
130 struct semid_kernel *sema = NULL; /* semaphore id pool */
286 * Expand the sema array to the given capacity. If the expansion fails
311 printf("growing sema[] from %d to %d\n", seminfo.semmni, newSize);
327 newSema[i] = sema[i];
336 if (sema[i].u.sem_perm.mode & SEM_ALLOC)
337 wakeup((caddr_t)&sema[i]);
354 if (sema)
355 FREE(sema, M_SYSVSEM);
357 sema = newSema;
411 if (sema[i].u.sem_perm.mode & SEM_ALLOC) /* ID in use */
412 sema[i].u.sem_base += (new_sem_pool - sem_pool);
674 semakptr = &sema[semid];
700 if ((sema[i].u.sem_perm.mode & SEM_ALLOC) &&
701 sema[i].u.sem_base > semakptr->u.sem_base)
702 sema[i].u.sem_base -= semakptr->u.sem_nsems;
882 if ((sema[semid].u.sem_perm.mode & SEM_ALLOC) &&
883 sema[semid].u.sem_perm._key == key)
890 if ((eval = ipcperm(cred, &sema[semid].u.sem_perm,
893 if (nsems < 0 || sema[semid].u.sem_nsems < nsems) {
908 eval = mac_sysvsem_check_semget(cred, &sema[semid]);
942 if ((sema[semid].u.sem_perm.mode & SEM_ALLOC) == 0)
952 printf("failed to grow sema array\n");
961 sema[semid].u.sem_perm._key = key;
962 sema[semid].u.sem_perm.cuid = kauth_cred_getuid(cred);
963 sema[semid].u.sem_perm.uid = kauth_cred_getuid(cred);
964 sema[semid].u.sem_perm.cgid = cred->cr_gid;
965 sema[semid].u.sem_perm.gid = cred->cr_gid;
966 sema[semid].u.sem_perm.mode = (semflg & 0777) | SEM_ALLOC;
967 sema[semid].u.sem_perm._seq =
968 (sema[semid].u.sem_perm._seq + 1) & 0x7fff;
969 sema[semid].u.sem_nsems = nsems;
970 sema[semid].u.sem_otime = 0;
971 sema[semid].u.sem_ctime = sysv_semtime();
972 sema[semid].u.sem_base = &sem_pool[semtot];
974 bzero(sema[semid].u.sem_base,
975 sizeof(sema[semid].u.sem_base[0])*nsems);
977 mac_sysvsem_label_associate(cred, &sema[semid]);
980 printf("sembase = 0x%x, next = 0x%x\n", sema[semid].u.sem_base,
992 *retval = IXSEQ_TO_IPCID(semid, sema[semid].u.sem_perm);
1032 semakptr = &sema[semid];
1208 semakptr = &sema[semid]; /* sema may have been reallocated */
1392 semakptr = &sema[semid];
1488 (sema == NULL) &&
1579 if (sema[cursor].u.sem_perm.mode & SEM_ALLOC)
1588 semid_dsp = &sema[cursor].u; /* default: 64 bit */