aboutsummaryrefslogtreecommitdiffstats
path: root/include/time.h
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>2001-10-28 19:54:49 +0000
committerMatthew Dillon <dillon@FreeBSD.org>2001-10-28 19:54:49 +0000
commit237c4e3a9e1e8c006edac8167088dfb130597e5c (patch)
tree4543d34cc7f31cf4431e62f7bbedbaf0179e4947 /include/time.h
parent7916863d823ee2b8a5d03dea0dd171c9c3d40c7f (diff)
downloadsrc-237c4e3a9e1e8c006edac8167088dfb130597e5c.tar.gz
src-237c4e3a9e1e8c006edac8167088dfb130597e5c.zip
Add routines to convert time_t to/from fixed-bit fields. These routines
serve two purposes: (1) so we can maintain backwards compatibility with protocols (rwhod, dump, etc...) that either assume time_t is 32 bits or assume sizeof(time_t) == sizeof(int), or make other similar assumptions. (2) To tag such routines (by the presence of these calls) for future cleanup/extension work. The 32->64 routine, time32_to_time() (when time_t is 64 bits, that is), is defined specifically to implement temporal locality to properly set the msb bits of a 64 bit time_t quantity, using the 50 year rule. The locality code has not been implemented yet (and doesn't need to be for a while), but that is the intent. This will allow us to maintain backwards protocol compatibility past 2038. These routines are intended to be platform and time_t agnostic. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=85634
Diffstat (limited to 'include/time.h')
-rw-r--r--include/time.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/time.h b/include/time.h
index 1e38cb2da707..6cff71399139 100644
--- a/include/time.h
+++ b/include/time.h
@@ -136,6 +136,13 @@ size_t strftime __P((char *, size_t, const char *, const struct tm *));
time_t time __P((time_t *));
#ifndef _ANSI_SOURCE
+time_t time32_to_time __P((__int32_t t32));
+__int32_t time_to_time32 __P((time_t t));
+time_t time64_to_time __P((__int64_t t64));
+__int64_t time_to_time64 __P((time_t t));
+#endif /* not ANSI */
+
+#ifndef _ANSI_SOURCE
void tzset __P((void));
#endif /* not ANSI */