semid_ds

Contains information about a semaphore set.

Service:Synchronization

Structure

  #include <sys/sem.h>
  
  struct semid_ds
  {
     struct ipc_perm   sem_perm;
     struct sem       *sem_base;
     unsigned short    sem_nsems;
     time_t            sem_otime;
     time_t            sem_ctime; 
     void             *sem_ptr;
     int               sem_realkey;
  };
  

Fields

sem_perm

Specifies an ipc_perm structure which contains information about access permissions, the creator, and the owner of the set.

sem_base

Points to the first semphore in the array. Each semaphore in the set has a sem structure.

sem_nsems

Specifies the number of semaphores in the set.

sem_otime

Specifies the time of the last semop operation.

sem_ctime

Specifies the last time the semaphore set changed.

sem_ptr

Points to the underlying semaphore.

sem_realkey

Specifies the semaphore key.

Remarks

The semctl function uses the semid_ds structure for the IPC_STAT and IPC_SET commands.