Info

struct sembuf {

unsigned short sem_num; /* semaphore index in array */

short sem_op; /* semaphore operation */

short sem_flg; /* operation flags */

This definition brings to mind the sample code shown in Section 5.3.2. It is exactly the same data structure used by the program to describe an operation on a semaphore. It holds not only the number of the semaphore in the semaphore set (sem_num) but also the desired operation (sem_op) and a number of operation flags (sem_flg).

Continue reading here: Implementing System Calls

Was this article helpful?

0 0