This commit is contained in:
Edi De Candido 2023-05-14 21:46:06 +02:00
parent 60b07f1d94
commit 5215bbb992
1 changed files with 12 additions and 0 deletions

12
src/custom_sem.c Normal file
View File

@ -0,0 +1,12 @@
#include <sys/sem.h>
#include <custom_sem.h>
#include <errExit.h>
void semOp(int semid, short sem_num, short sem_op) {
struct sembuf sop = {.sem_num = sem_num, .sem_op = sem_op, .sem_flg = 0};
if (semop(semid, &sop, 1) == -1) {
errExit("semop", "semOp");
}
}