source: rtems/cpukit/posix/include/semaphore.h @ 0ff3df03

4.104.114.84.95
Last change on this file since 0ff3df03 was 0ff3df03, checked in by Ralf Corsepius <ralf.corsepius@…>, on Dec 10, 2004 at 4:17:50 AM

2004-12-10 Ralf Corsepius <ralf.corsepius@…>

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