4.115
Last change
on this file since 92119ed was
69b1322,
checked in by Joel Sherrill <joel.sherrill@…>, on 03/22/10 at 13:38:04
|
2010-03-22 Joel Sherrill <joel.sherrill@…>
- libcsupport/src/sleep_noposix.c: Fix warning and bug.
|
-
Property mode set to
100644
|
File size:
1000 bytes
|
Line | |
---|
1 | /* |
---|
2 | * Marginal implementations of some POSIX API routines |
---|
3 | * to be used when POSIX is disabled. |
---|
4 | * |
---|
5 | * + kill |
---|
6 | * + _kill_r |
---|
7 | * + __kill |
---|
8 | * + sleep |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.rtems.com/license/LICENSE. |
---|
13 | * |
---|
14 | * $Id$ |
---|
15 | */ |
---|
16 | |
---|
17 | #if HAVE_CONFIG_H |
---|
18 | #include "config.h" |
---|
19 | #endif |
---|
20 | |
---|
21 | #include <rtems.h> |
---|
22 | |
---|
23 | #include <unistd.h> |
---|
24 | |
---|
25 | /* |
---|
26 | * 3.4.3 Delay Process Execution, P1003.1b-1993, p. 81 |
---|
27 | * |
---|
28 | * $Id$ |
---|
29 | */ |
---|
30 | |
---|
31 | #include <time.h> |
---|
32 | #include <unistd.h> |
---|
33 | |
---|
34 | #include <rtems.h> |
---|
35 | |
---|
36 | #if !defined(RTEMS_POSIX_API) |
---|
37 | unsigned int sleep( |
---|
38 | unsigned int seconds |
---|
39 | ) |
---|
40 | { |
---|
41 | rtems_status_code status; |
---|
42 | rtems_interval ticks_per_second; |
---|
43 | |
---|
44 | ticks_per_second = rtems_clock_get_ticks_per_second() * seconds; |
---|
45 | |
---|
46 | status = rtems_task_wake_after( ticks_per_second ); |
---|
47 | |
---|
48 | /* |
---|
49 | * Returns the "unslept" amount of time. In RTEMS signals are not |
---|
50 | * interruptable, so tasks really sleep all of the requested time. |
---|
51 | */ |
---|
52 | |
---|
53 | return 0; |
---|
54 | } |
---|
55 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.