Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

47. System V Semaphores > Semaphore Associated Data Structure

Semaphore Associated Data Structure

Each semaphore set has an associated semid_ds data structure of the following form:

struct semid_ds {
    struct ipc_perm sem_perm;       /* Ownership and permissions */
    time_t          sem_otime;      /* Time of last semop() */
    time_t          sem_ctime;      /* Time of last change */
    unsigned long   sem_nsems;      /* Number of semaphores in set */
};

Note

SUSv3 requires all of the fields that we show in the semid_ds structure. Some other UNIX implementations include additional nonstandard fields. On Linux 2.4 and later, the sem_nsems field is typed as unsigned long. SUSv3 specifies the type of this field as unsigned short, and it is so defined in Linux 2.2 and on most other UNIX implementations.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint