The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

semaphore.h - semaphores (REALTIME)

 SYNOPSIS



#include <semaphore.h>

 DESCRIPTION

The <semaphore.h> header defines the sem_t type, used in performing semaphore operations. The semaphore may be implemented using 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()).

The following are declared as functions and may also be declared as macros. Function prototypes must be provided for use with an ISO C compiler.


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>.

 APPLICATION USAGE

None.

 FUTURE DIRECTIONS

None.

 SEE ALSO

<fcntl.h>, <sys/types.h>.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]