From c885bf5cf94a12202f849477a845d728cbd12889 Mon Sep 17 00:00:00 2001
From: "Peter S. Mazinger" <ps.m@gmx.net>
Date: Sat, 3 Dec 2005 00:34:49 +0000
Subject: More hiding, including __mempcpy

---
 libc/misc/time/adjtime.c |  3 ++-
 libc/misc/time/time.c    | 27 ++++++++++++++++++---------
 2 files changed, 20 insertions(+), 10 deletions(-)

(limited to 'libc/misc/time')

diff --git a/libc/misc/time/adjtime.c b/libc/misc/time/adjtime.c
index 2049bc896..fd33ff60d 100644
--- a/libc/misc/time/adjtime.c
+++ b/libc/misc/time/adjtime.c
@@ -1,3 +1,5 @@
+#define adjtimex __adjtimex
+
 #include <limits.h>
 #include <sys/time.h>
 #include <sys/timex.h>
@@ -49,4 +51,3 @@ adjtime(const struct timeval * itv, struct timeval * otv)
   }
   return 0;
 }
-
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
-- 
cgit v1.2.3