4.104.115
Line | |
---|
1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2008. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.com/license/LICENSE. |
---|
8 | * |
---|
9 | * $Id$ |
---|
10 | */ |
---|
11 | |
---|
12 | #if HAVE_CONFIG_H |
---|
13 | #include "config.h" |
---|
14 | #endif |
---|
15 | |
---|
16 | #include <stdarg.h> |
---|
17 | |
---|
18 | #include <errno.h> |
---|
19 | #include <fcntl.h> |
---|
20 | #include <pthread.h> |
---|
21 | #include <semaphore.h> |
---|
22 | #include <limits.h> |
---|
23 | |
---|
24 | #include <rtems/system.h> |
---|
25 | #include <rtems/score/object.h> |
---|
26 | #include <rtems/posix/semaphore.h> |
---|
27 | #include <rtems/posix/time.h> |
---|
28 | #include <rtems/seterr.h> |
---|
29 | |
---|
30 | /*PAGE |
---|
31 | * |
---|
32 | * 11.2.6 Lock a Semaphore, P1003.1b-1993, p.226 |
---|
33 | * |
---|
34 | * NOTE: P1003.4b/D8 adds sem_timedwait(), p. 27 |
---|
35 | */ |
---|
36 | |
---|
37 | int sem_trywait( |
---|
38 | sem_t *sem |
---|
39 | ) |
---|
40 | { |
---|
41 | return _POSIX_Semaphore_Wait_support(sem, false, THREAD_QUEUE_WAIT_FOREVER); |
---|
42 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.