source:
rtems/c/src/exec/posix/src/time.c
@
9f95a19
Last change on this file since 9f95a19 was 9f95a19, checked in by Joel Sherrill <joel.sherrill@…>, on 11/02/99 at 18:35:52 | |
---|---|
|
|
File size: 849 bytes |
Rev | Line | |
---|---|---|
[7f72217e] | 1 | /* |
[eb5a7e07] | 2 | * $Id$ |
[5e9b32b] | 3 | */ |
4 | ||
[5600661] | 5 | #include <assert.h> |
[5e9b32b] | 6 | #include <time.h> |
[5600661] | 7 | #include <errno.h> |
[f4719d5a] | 8 | |
9 | #include <rtems/system.h> | |
[5600661] | 10 | #include <rtems/score/isr.h> |
11 | #include <rtems/score/thread.h> | |
[5e9b32b] | 12 | #include <rtems/score/tod.h> |
13 | ||
[05ce4e09] | 14 | #include <rtems/posix/seterr.h> |
[5ff991e8] | 15 | #include <rtems/posix/time.h> |
[5e9b32b] | 16 | |
[5b748a1] | 17 | /*PAGE |
18 | * | |
[5e9b32b] | 19 | * 4.5.1 Get System Time, P1003.1b-1993, p. 91 |
20 | */ | |
21 | ||
[52d99d4a] | 22 | /* Using the implementation in newlib */ |
23 | #if 0 | |
[5e9b32b] | 24 | time_t time( |
25 | time_t *tloc | |
26 | ) | |
27 | { | |
28 | time_t seconds_since_epoch; | |
29 | ||
[40cfab47] | 30 | /* |
31 | * No error is the time of day is not set. For RTEMS the system time | |
32 | * starts out at the rtems epoch. | |
33 | */ | |
[5e9b32b] | 34 | |
35 | /* | |
36 | * Internally the RTEMS epoch is 1988. This must be taken into account. | |
37 | */ | |
38 | ||
39 | seconds_since_epoch = _TOD_Seconds_since_epoch; | |
40 | ||
41 | seconds_since_epoch += POSIX_TIME_SECONDS_1970_THROUGH_1988; | |
42 | ||
43 | if ( tloc ) | |
44 | *tloc = seconds_since_epoch; | |
45 | ||
46 | return seconds_since_epoch; | |
47 | } | |
[52d99d4a] | 48 | #endif |
Note: See TracBrowser
for help on using the repository browser.