semaphore(4)


semaphore -- header file for POSIX thread semaphores

Synopsis

   #include <semaphore.h>

Description

The semaphore.h header defines the sem_t type, used in performing semaphore operations. The semaphore created via sem_open.3pthread uses a file descriptor, in which case applications are able to open up at least a total of OPEN_MAX files and semaphores.

The symbol SEM_FAILED is defined (see sem_open(3pthread)).

The following are declared as functions and may also be declared as macros.

   int    sem_close(sem_t *);
   int    sem_destroy(sem_t *);
   int    sem_getvalue(sem_t *, int *);
   int    sem_init(sem_t *, int, unsigned int);
   sem_t *sem_open(const char *, int, ...);
   int    sem_post(sem_t *);
   int    sem_trywait(sem_t *);
   int    sem_unlink(const char *);
   int    sem_wait(sem_t *);

Inclusion of the semaphore.h header may make visible symbols defined in the headers fcntl.h and sys/types.h.

References

fcntl(5), sem_open(3pthread)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004