semaphore.h File Reference

Semaphores. More...

Detailed Description

#include <errno.h>
#include <time.h>
#include "sema.h"
+ Include dependency graph for semaphore.h:

Go to the source code of this file.

Macros

#define SEM_FAILED   ((sem_t *) 0)
 Value returned if `sem_open' failed.
 

Typedefs

typedef sema_t sem_t
 POSIX-specific semaphore type.
 

Functions

static int sem_init (sem_t *sem, int pshared, unsigned value)
 Initialize an unnamed semaphore. More...
 
static int sem_destroy (sem_t *sem)
 destroy an unnamed semaphore More...
 
static int sem_post (sem_t *sem)
 Unlock a semaphore. More...
 
static int sem_wait (sem_t *sem)
 Lock a semaphore. More...
 
static sem_tsem_open (const char *name, int oflag,...)
 Open a named semaphore name with open flags oflag. More...
 
static int sem_close (sem_t *sem)
 Close descriptor for named semaphore sem. More...
 
static int sem_unlink (const char *name)
 Remove named semaphore name. More...
 
int sem_timedwait (sem_t *sem, const struct timespec *abstime)
 Similar to `sem_wait' but wait only until abstime. More...
 
static int sem_trywait (sem_t *sem)
 Test whether sem is posted. More...
 
static int sem_getvalue (sem_t *sem, int *sval)
 Get current value of sem and store it in sval. More...