Lines Matching refs:semid
120 int semid, int semnum, int adjval);
121 static void semundo_clear(int semid, int semnum);
514 semundo_adjust(struct proc *p, int *supidx, int semid,
555 if (sueptr->une_id != semid || sueptr->une_num != semnum)
593 new_sueptr->une_id = semid;
602 semundo_clear(int semid, int semnum)
616 if (sueptr->une_id == semid) {
644 int semid = uap->semid;
656 AUDIT_ARG(svipc_id, semid);
661 printf("call to semctl(%d, %d, %d, 0x%qx)\n", semid, semnum, cmd, user_arg);
664 semid = IPCID_TO_IX(semid);
666 if (semid < 0 || semid >= seminfo.semmni) {
668 printf("Invalid semid\n");
674 semakptr = &sema[semid];
676 semakptr->u.sem_perm._seq != IPCID_TO_SEQ(uap->semid)) {
708 semundo_clear(semid, -1);
826 semundo_clear(semid, semnum);
844 semundo_clear(semid, -1);
863 int semid, eval;
881 for (semid = 0; semid < seminfo.semmni; semid++) {
882 if ((sema[semid].u.sem_perm.mode & SEM_ALLOC) &&
883 sema[semid].u.sem_perm._key == key)
886 if (semid < seminfo.semmni) {
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]);
941 for (semid = 0; semid < seminfo.semmni; semid++) {
942 if ((sema[semid].u.sem_perm.mode & SEM_ALLOC) == 0)
945 if (semid == seminfo.semmni) {
959 printf("semid %d is available\n", semid);
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);
1007 int semid = uap->semid;
1017 AUDIT_ARG(svipc_id, uap->semid);
1022 printf("call to semop(%d, 0x%x, %d)\n", semid, sops, nsops);
1025 semid = IPCID_TO_IX(semid); /* Convert back to zero origin */
1027 if (semid < 0 || semid >= seminfo.semmni) {
1032 semakptr = &sema[semid];
1037 if (semakptr->u.sem_perm._seq != IPCID_TO_SEQ(uap->semid)) {
1208 semakptr = &sema[semid]; /* sema may have been reallocated */
1210 semakptr->u.sem_perm._seq != IPCID_TO_SEQ(uap->semid) ||
1264 eval = semundo_adjust(p, &supidx, semid,
1284 if (semundo_adjust(p, &supidx, semid,
1382 int semid;
1388 semid = sueptr->une_id;
1392 semakptr = &sema[semid];
1394 panic("semexit - semid not allocated");
1401 semid,