Last change
on this file since 577 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
1.1 KB
|
Line | |
---|
1 | /* |
---|
2 | * localtime.c |
---|
3 | */ |
---|
4 | |
---|
5 | /* |
---|
6 | FUNCTION |
---|
7 | <<localtime>>---convert time to local representation |
---|
8 | |
---|
9 | INDEX |
---|
10 | localtime |
---|
11 | INDEX |
---|
12 | localtime_r |
---|
13 | |
---|
14 | SYNOPSIS |
---|
15 | #include <time.h> |
---|
16 | struct tm *localtime(time_t *<[clock]>); |
---|
17 | struct tm *localtime_r(time_t *<[clock]>, struct tm *<[res]>); |
---|
18 | |
---|
19 | DESCRIPTION |
---|
20 | <<localtime>> converts the time at <[clock]> into local time, then |
---|
21 | converts its representation from the arithmetic representation to the |
---|
22 | traditional representation defined by <<struct tm>>. |
---|
23 | |
---|
24 | <<localtime>> constructs the traditional time representation in static |
---|
25 | storage; each call to <<gmtime>> or <<localtime>> will overwrite the |
---|
26 | information generated by previous calls to either function. |
---|
27 | |
---|
28 | <<mktime>> is the inverse of <<localtime>>. |
---|
29 | |
---|
30 | RETURNS |
---|
31 | A pointer to the traditional time representation (<<struct tm>>). |
---|
32 | |
---|
33 | PORTABILITY |
---|
34 | ANSI C requires <<localtime>>. |
---|
35 | |
---|
36 | <<localtime>> requires no supporting OS subroutines. |
---|
37 | */ |
---|
38 | |
---|
39 | #include <stdlib.h> |
---|
40 | #include <time.h> |
---|
41 | #include <reent.h> |
---|
42 | |
---|
43 | #ifndef _REENT_ONLY |
---|
44 | |
---|
45 | struct tm * |
---|
46 | localtime (const time_t * tim_p) |
---|
47 | { |
---|
48 | struct _reent *reent = _REENT; |
---|
49 | |
---|
50 | _REENT_CHECK_TM(reent); |
---|
51 | return localtime_r (tim_p, (struct tm *)_REENT_TM(reent)); |
---|
52 | } |
---|
53 | |
---|
54 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.