source: rtems/cpukit/posix/include/semaphore.h @ f22ebf0

4.104.114.84.95
Last change on this file since f22ebf0 was c7aa9d6, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 26, 1999 at 6:22:08 PM

Repairing damage and recovering changes including C++ wrappers..

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*  semaphore.h
2 *
3 *  $Id$
4 */
5
6#ifndef __POSIX_SEMAPHORE_h
7#define __POSIX_SEMAPHORE_h
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13#include <sys/features.h>
14
15#if defined(_POSIX_SEMAPHORES)
16
17#include <sys/time.h>
18
19/*
20 *  11.1 Semaphore Characteristics, P1003.1b-1993, p.219
21 */
22
23typedef int sem_t;
24
25/*
26 *  11.2.1 Initialize an Unnamed Semaphore, P1003.1b-1993, p.219
27 */
28
29int sem_init(
30  sem_t         *sem,
31  int            pshared,
32  unsigned int   value
33);
34
35/*
36 *  11.2.2 Destroy an Unnamed Semaphore, P1003.1b-1993, p.220
37 */
38
39int sem_destroy(
40  sem_t *sem
41);
42
43/*
44 *  11.2.3 Initialize/Open a Named Semaphore, P1003.1b-1993, p.221
45 *
46 *  NOTE: Follows open() calling conventions.
47 */
48
49sem_t *sem_open(
50  const char *name,
51  int         oflag,
52  ...
53);
54
55/*
56 *  11.2.4 Close a Named Semaphore, P1003.1b-1993, p.224
57 */
58
59int sem_close(
60  sem_t *sem
61);
62
63/*
64 *  11.2.5 Remove a Named Semaphore, P1003.1b-1993, p.225
65 */
66
67int sem_unlink(
68  const char *name
69);
70
71/*
72 *  11.2.6 Lock a Semaphore, P1003.1b-1993, p.226
73 *
74 *  NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27
75 */
76
77int sem_wait(
78  sem_t *sem
79);
80
81int sem_trywait(
82  sem_t *sem
83);
84
85#if defined(_POSIX_TIMEOUTS)
86int sem_timedwait(
87  sem_t                 *sem,
88  const struct timespec *timeout
89);
90#endif
91
92/*
93 *  11.2.7 Unlock a Semaphore, P1003.1b-1993, p.227
94 */
95
96int sem_post(
97  sem_t  *sem
98);
99
100/*
101 *  11.2.8 Get the Value of a Semaphore, P1003.1b-1993, p.229
102 */
103
104int sem_getvalue(
105  sem_t  *sem,
106  int    *sval
107);
108
109#endif   /* _POSIX_SEMAPHORES */
110
111#ifdef __cplusplus
112}
113#endif
114
115#endif
116/* end of include file */
Note: See TracBrowser for help on using the repository browser.