Is there a way to do multiple increments / decrements on distinct semaphores in one (atomic) operation?
I saw that in SysV it is possible to do this and I was wondering if there was a way to do the same using POSIX API.
Here's what I would like to do (in SysV):
sem[0].sem_num = 0;
sem[0].sem_op = 1;
sem[0].sem_flg = 0;
sem[1].sem_num = 1;
sem[1].sem_op = -1;
sem[1].sem_flg = 0;
semop(semid, sem, 2)
Is there a way to do the same in POSIX?