diff options
Diffstat (limited to 'libc/misc/time/time.c')
-rw-r--r-- | libc/misc/time/time.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c index 4d3c43492..3c47cb879 100644 --- a/libc/misc/time/time.c +++ b/libc/misc/time/time.c @@ -184,6 +184,11 @@ extern struct tm __time_tm; +extern struct tm *__localtime_r (__const time_t *__restrict __timer, + struct tm *__restrict __tp) attribute_hidden; + +extern struct tm *__localtime (__const time_t *__timer) attribute_hidden; + typedef struct { long gmt_offset; long dst_offset; @@ -386,6 +391,8 @@ strong_alias(__asctime_r,asctime_r) /**********************************************************************/ #ifdef L_clock +#define times __times + #include <sys/times.h> #ifndef __BCC__ @@ -452,12 +459,12 @@ clock_t clock(void) /**********************************************************************/ #ifdef L_ctime -char *ctime(const time_t *clock) +char attribute_hidden *__ctime(const time_t *clock) { /* ANSI/ISO/SUSv3 say that ctime is equivalent to the following. */ - return __asctime(localtime(clock)); + return __asctime(__localtime(clock)); } - +strong_alias(__ctime,ctime) #endif /**********************************************************************/ #ifdef L_ctime_r @@ -466,7 +473,7 @@ char *ctime_r(const time_t *clock, char *buf) { struct tm xtm; - return __asctime_r(localtime_r(clock, &xtm), buf); + return __asctime_r(__localtime_r(clock, &xtm), buf); } #endif @@ -534,22 +541,23 @@ struct tm *gmtime_r(const time_t *__restrict timer, /**********************************************************************/ #ifdef L_localtime -struct tm *localtime(const time_t *timer) +struct tm attribute_hidden *__localtime(const time_t *timer) { register struct tm *ptm = &__time_tm; /* In this implementation, tzset() is called by localtime_r(). */ - localtime_r(timer, ptm); /* Can return NULL... */ + __localtime_r(timer, ptm); /* Can return NULL... */ return ptm; } +strong_alias(__localtime,localtime) #endif /**********************************************************************/ #ifdef L_localtime_r -struct tm *localtime_r(register const time_t *__restrict timer, +struct tm attribute_hidden *__localtime_r(register const time_t *__restrict timer, register struct tm *__restrict result) { TZLOCK; @@ -562,6 +570,7 @@ struct tm *localtime_r(register const time_t *__restrict timer, return result; } +strong_alias(__localtime_r,localtime_r) #endif /**********************************************************************/ @@ -1542,7 +1551,7 @@ char *__XL(strptime)(const char *__restrict buf, const char *__restrict format, buf = o; if (!code) { /* s */ - localtime_r(&t, tm); /* TODO: check for failure? */ + __localtime_r(&t, tm); /* TODO: check for failure? */ i = 0; do { /* Now copy values from tm to fields. */ fields[i] = ((int *) tm)[i]; @@ -1806,7 +1815,7 @@ void tzset(void) TZLOCK; - e = getenv(TZ); /* TZ env var always takes precedence. */ + e = __getenv(TZ); /* TZ env var always takes precedence. */ #if defined(__UCLIBC_HAS_TZ_FILE__) && !defined(__UCLIBC_HAS_TZ_FILE_READ_MANY__) /* Put this inside the lock to prevent the possiblity of two different |