summaryrefslogtreecommitdiffstats
path: root/src/include/sys
diff options
context:
space:
mode:
authorMichael Brown2012-03-19 17:09:41 +0100
committerMichael Brown2012-03-19 18:35:46 +0100
commitbd6805a8c18f859a8f467965f2ee780817d8a81e (patch)
treed228abb380a1acf56ccadce6ea98de2918696631 /src/include/sys
parent[crypto] Use correct constraint for byte-addressable register (diff)
downloadipxe-bd6805a8c18f859a8f467965f2ee780817d8a81e.tar.gz
ipxe-bd6805a8c18f859a8f467965f2ee780817d8a81e.tar.xz
ipxe-bd6805a8c18f859a8f467965f2ee780817d8a81e.zip
[libc] Add mktime() function
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/sys')
-rw-r--r--src/include/sys/time.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/include/sys/time.h b/src/include/sys/time.h
index 21fb7e99..6c9b7421 100644
--- a/src/include/sys/time.h
+++ b/src/include/sys/time.h
@@ -1,20 +1,18 @@
#ifndef _SYS_TIME_H
#define _SYS_TIME_H
-#include <time.h>
+/** @file
+ *
+ * Date and time
+ */
-typedef unsigned long suseconds_t;
+#include <stdint.h>
-struct timeval {
- time_t tv_sec; /* seconds */
- suseconds_t tv_usec; /* microseconds */
-};
-
-struct timezone {
- int tz_minuteswest; /* minutes W of Greenwich */
- int tz_dsttime; /* type of dst correction */
-};
-
-extern int gettimeofday ( struct timeval *tv, struct timezone *tz );
+/** Seconds since the Epoch
+ *
+ * We use a 64-bit type to avoid Y2K38 issues, since we may have to
+ * handle distant future dates (e.g. X.509 certificate expiry dates).
+ */
+typedef int64_t time_t;
#endif /* _SYS_TIME_H */