4.104.115
Last change
on this file since 1eb97ad was
1eb97ad,
checked in by Joel Sherrill <joel.sherrill@…>, on 12/01/09 at 14:22:58
|
2009-12-01 Joel Sherrill <joel.sherrill@…>
- libcsupport/Makefile.am: Split no_posix.c so using sleep() does not
pull in kill() stubs.
- libcsupport/src/kill_noposix.c, libcsupport/src/sleep_noposix.c:
New files.
- libcsupport/src/no_posix.c: Removed.
|
-
Property mode set to
100644
|
File size:
1016 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 | rtems_interval ticks; |
---|
44 | |
---|
45 | ticks_per_second = rtems_clock_get_ticks_per_second() * seconds; |
---|
46 | |
---|
47 | status = rtems_task_wake_after( ticks ); |
---|
48 | |
---|
49 | /* |
---|
50 | * Returns the "unslept" amount of time. In RTEMS signals are not |
---|
51 | * interruptable, so tasks really sleep all of the requested time. |
---|
52 | */ |
---|
53 | |
---|
54 | return 0; |
---|
55 | } |
---|
56 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.