summaryrefslogtreecommitdiff
path: root/lib/libc/time
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/time')
-rw-r--r--lib/libc/time/asctime.c4
-rw-r--r--lib/libc/time/localtime.c18
-rw-r--r--lib/libc/time/strftime.c3
-rw-r--r--lib/libc/time/strptime.c3
4 files changed, 24 insertions, 4 deletions
diff --git a/lib/libc/time/asctime.c b/lib/libc/time/asctime.c
index 403cfcc361c..16203d747e7 100644
--- a/lib/libc/time/asctime.c
+++ b/lib/libc/time/asctime.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asctime.c,v 1.21 2015/02/16 17:35:38 tedu Exp $ */
+/* $OpenBSD: asctime.c,v 1.22 2015/09/12 14:35:40 guenther Exp $ */
/*
** This file is in the public domain, so clarified as of
** 1996-06-05 by Arthur David Olson.
@@ -117,6 +117,7 @@ asctime_r(const struct tm *timeptr, char *buf)
*/
return asctime3(timeptr, buf, STD_ASCTIME_BUF_SIZE);
}
+DEF_WEAK(asctime_r);
/*
** A la ISO/IEC 9945-1, ANSI/IEEE Std 1003.1, 2004 Edition.
@@ -134,3 +135,4 @@ asctime(const struct tm *timeptr)
else
return asctime3(timeptr, resultp, sizeof(result));
}
+DEF_STRONG(asctime);
diff --git a/lib/libc/time/localtime.c b/lib/libc/time/localtime.c
index 4e1d22b476a..c84649affcb 100644
--- a/lib/libc/time/localtime.c
+++ b/lib/libc/time/localtime.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: localtime.c,v 1.52 2015/04/07 01:47:04 millert Exp $ */
+/* $OpenBSD: localtime.c,v 1.53 2015/09/12 14:35:40 guenther Exp $ */
/*
** This file is in the public domain, so clarified as of
** 1996-06-05 by Arthur David Olson.
@@ -168,6 +168,15 @@ static int tzload(const char * name, struct state * sp,
static int tzparse(const char * name, struct state * sp,
int lastditch);
+#ifdef STD_INSPIRED
+struct tm *offtime(const time_t *, long);
+time_t time2posix(time_t);
+time_t posix2time(time_t);
+PROTO_DEPRECATED(offtime);
+PROTO_DEPRECATED(time2posix);
+PROTO_DEPRECATED(posix2time);
+#endif
+
static struct state * lclptr;
static struct state * gmtptr;
@@ -186,6 +195,7 @@ char * tzname[2] = {
wildabbr,
wildabbr
};
+DEF_WEAK(tzname);
/*
** Section 4.12.3 of X3.159-1989 requires that
@@ -1169,6 +1179,7 @@ tzset(void)
tzset_basic();
_THREAD_PRIVATE_MUTEX_UNLOCK(lcl);
}
+DEF_WEAK(tzset);
/*
** The easy way to behave "as if no library function calls" localtime
@@ -1285,6 +1296,7 @@ localtime_r(const time_t *timep, struct tm *p_tm)
_THREAD_PRIVATE_MUTEX_UNLOCK(lcl);
return p_tm;
}
+DEF_WEAK(localtime_r);
struct tm *
localtime(const time_t *timep)
@@ -1296,6 +1308,7 @@ localtime(const time_t *timep)
return NULL;
return localtime_r(timep, p_tm);
}
+DEF_STRONG(localtime);
/*
** gmtsub is to gmtime as localsub is to localtime.
@@ -1343,6 +1356,7 @@ gmtime_r(const time_t *timep, struct tm *p_tm)
gmtsub(timep, 0L, p_tm);
return p_tm;
}
+DEF_WEAK(gmtime_r);
struct tm *
gmtime(const time_t *timep)
@@ -1355,6 +1369,7 @@ gmtime(const time_t *timep)
return gmtime_r(timep, p_tm);
}
+DEF_WEAK(gmtime);
#ifdef STD_INSPIRED
@@ -1876,6 +1891,7 @@ mktime(struct tm *tmp)
_THREAD_PRIVATE_MUTEX_UNLOCK(lcl);
return ret;
}
+DEF_STRONG(mktime);
#ifdef STD_INSPIRED
diff --git a/lib/libc/time/strftime.c b/lib/libc/time/strftime.c
index 4c117f184c9..84c4c18e38f 100644
--- a/lib/libc/time/strftime.c
+++ b/lib/libc/time/strftime.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strftime.c,v 1.26 2015/02/16 17:11:54 tedu Exp $ */
+/* $OpenBSD: strftime.c,v 1.27 2015/09/12 14:35:40 guenther Exp $ */
/*
** Copyright (c) 1989, 1993
** The Regents of the University of California. All rights reserved.
@@ -136,6 +136,7 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *t)
*p = '\0';
return p - s;
}
+DEF_STRONG(strftime);
static char *
_fmt(const char *format, const struct tm *t, char *pt, const char *ptlim, int *warnp)
diff --git a/lib/libc/time/strptime.c b/lib/libc/time/strptime.c
index 8c337a2ce1e..fe78b476b98 100644
--- a/lib/libc/time/strptime.c
+++ b/lib/libc/time/strptime.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strptime.c,v 1.20 2015/04/07 01:49:11 millert Exp $ */
+/* $OpenBSD: strptime.c,v 1.21 2015/09/12 14:35:40 guenther Exp $ */
/* $NetBSD: strptime.c,v 1.12 1998/01/20 21:39:40 mycroft Exp $ */
/*-
* Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc.
@@ -83,6 +83,7 @@ strptime(const char *buf, const char *fmt, struct tm *tm)
{
return(_strptime(buf, fmt, tm, 1));
}
+DEF_WEAK(strptime);
static char *
_strptime(const char *buf, const char *fmt, struct tm *tm, int initialize)