summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/null_time.h
diff options
context:
space:
mode:
authorMichael Brown2012-03-19 17:59:53 +0100
committerMichael Brown2012-03-19 23:13:27 +0100
commit846bde90e6b1001480016fa46a957a9e726af68a (patch)
treecf3dfaaef4c90864c11c707482fde92f49b4abf7 /src/include/ipxe/null_time.h
parent[test] Add self-tests for mktime() (diff)
downloadipxe-846bde90e6b1001480016fa46a957a9e726af68a.tar.gz
ipxe-846bde90e6b1001480016fa46a957a9e726af68a.tar.xz
ipxe-846bde90e6b1001480016fa46a957a9e726af68a.zip
[time] Define an API for getting the current time
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/null_time.h')
-rw-r--r--src/include/ipxe/null_time.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/include/ipxe/null_time.h b/src/include/ipxe/null_time.h
new file mode 100644
index 000000000..2b72cdf50
--- /dev/null
+++ b/src/include/ipxe/null_time.h
@@ -0,0 +1,23 @@
+#ifndef _IPXE_NULL_TIME_H
+#define _IPXE_NULL_TIME_H
+
+/** @file
+ *
+ * Nonexistent time source
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+#ifdef TIME_NULL
+#define TIME_PREFIX_null
+#else
+#define TIME_PREFIX_null __null_
+#endif
+
+static inline __always_inline time_t
+TIME_INLINE ( null, time_now ) ( void ) {
+ return 0;
+}
+
+#endif /* _IPXE_NULL_TIME_H */