source: rtems/cpukit/posix/include/semaphore.h @ 92262ab

4.104.114.84.95
Last change on this file since 92262ab was eb5a7e07, checked in by Joel Sherrill <joel.sherrill@…>, on 10/06/95 at 20:48:38

fixed missing CVS IDs

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