Lines Matching refs:sembuffer
77 int get_semaphore(int sem_id, struct sembuf *sembuffer) in get_semaphore() argument
79 sembuffer->sem_num = 0; in get_semaphore()
80 sembuffer->sem_op = -1; in get_semaphore()
81 sembuffer->sem_flg = SEM_UNDO; in get_semaphore()
82 return semop(sem_id, sembuffer, 1); in get_semaphore()
85 int put_semaphore(int sem_id, struct sembuf *sembuffer) in put_semaphore() argument
87 sembuffer->sem_num = 0; in put_semaphore()
88 sembuffer->sem_op = 1; in put_semaphore()
89 sembuffer->sem_flg = SEM_UNDO; in put_semaphore()
90 return semop(sem_id, sembuffer, 1); in put_semaphore()
131 struct sembuf sembuffer; in main() local
238 if (get_semaphore(semid, &sembuffer)) { in main()
265 if (put_semaphore(semid, &sembuffer)) in main()
269 if (get_semaphore(semid, &sembuffer)) in main()
271 if (put_semaphore(semid, &sembuffer)) in main()
278 if (forkflag && get_semaphore(semid, &sembuffer)) { in main()
292 if (forkflag && put_semaphore(semid, &sembuffer)) { in main()