Inter-Process Communication
***************************

This chapter describes the glibcadj inter-process communication primitives.

Semaphores
==========

Theglibc implements the semaphore APIs as defined in POSIX and System V.  Semaphores can be used by multiple processes to coordinate shared resources.  The following is a complete list of the semaphore functions provided by theglibc.

System V Semaphores
-------------------

 -- Function: int semctl (int SEMID, int SEMNUM, int CMD);
     prelim mtsafe assafe/linux

 -- Function: int semget (key_t KEY, int NSEMS, int SEMFLG);

 -- Function: int semop (int SEMID, struct sembuf *SOPS, size_t NSOPS);

 -- Function: int semtimedop (int SEMID, struct sembuf *SOPS, size_t NSOPS, const struct timespec *TIMEOUT);

POSIX Semaphores
----------------

 -- Function: int sem_init (sem_t *SEM, int PSHARED, unsigned int VALUE);

 -- Function: int sem_destroy (sem_t *SEM);

 -- Function: sem_t *sem_open (const char *NAME, int OFLAG, ...);

 -- Function: int sem_close (sem_t *SEM);

 -- Function: int sem_unlink (const char *NAME);

 -- Function: int sem_wait (sem_t *SEM);

 -- Function: int sem_timedwait (sem_t *SEM, const struct timespec *ABSTIME);

 -- Function: int sem_trywait (sem_t *SEM);

 -- Function: int sem_post (sem_t *SEM);

 -- Function: int sem_getvalue (sem_t *SEM, int *SVAL);