1<semaphore.h>(0P) POSIX Programmer's Manual <semaphore.h>(0P)
2
3
4
6 semaphore.h - semaphores (REALTIME)
7
9 #include <semaphore.h>
10
12 The <semaphore.h> header shall define the sem_t type, used in performâ
13 ing semaphore operations. The semaphore may be implemented using a file
14 descriptor, in which case applications are able to open up at least a
15 total of {OPEN_MAX} files and semaphores. The symbol SEM_FAILED shall
16 be defined (see sem_open()).
17
18 The following shall be declared as functions and may also be defined as
19 macros. Function prototypes shall be provided.
20
21
22 int sem_close(sem_t *);
23 int sem_destroy(sem_t *);
24 int sem_getvalue(sem_t *restrict, int *restrict);
25 int sem_init(sem_t *, int, unsigned);
26 sem_t *sem_open(const char *, int, ...);
27 int sem_post(sem_t *);
28
29 int sem_timedwait(sem_t *restrict, const struct timespec *restrict);
30
31 int sem_trywait(sem_t *);
32 int sem_unlink(const char *);
33 int sem_wait(sem_t *);
34
35 Inclusion of the <semaphore.h> header may make visible symbols defined
36 in the headers <fcntl.h> and <sys/types.h>.
37
38 The following sections are informative.
39
41 None.
42
44 None.
45
47 None.
48
50 <fcntl.h>, <sys/types.h>, the System Interfaces volume of
51 IEEE Std 1003.1-2001, sem_destroy(), sem_getvalue(), sem_init(),
52 sem_open(), sem_post(), sem_timedwait(), sem_trywait(), sem_unlink(),
53 sem_wait()
54
56 Portions of this text are reprinted and reproduced in electronic form
57 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
58 -- Portable Operating System Interface (POSIX), The Open Group Base
59 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
60 Electrical and Electronics Engineers, Inc and The Open Group. In the
61 event of any discrepancy between this version and the original IEEE and
62 The Open Group Standard, the original IEEE and The Open Group Standard
63 is the referee document. The original Standard can be obtained online
64 at http://www.opengroup.org/unix/online.html .
65
66
67
68IEEE/The Open Group 2003 <semaphore.h>(0P)