about summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-10-19 11:51:48 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-10-27 09:54:50 -0300
commit5d8aa97da2332a818579bbb24880f9d44715448a (patch)
tree649294cdab8924f0905bc9bdc6c03a24627582b9 /include
parent30a0b167d347dd80807d167ee85bf58264fb8b76 (diff)
downloadglibc-5d8aa97da2332a818579bbb24880f9d44715448a.tar.gz
glibc-5d8aa97da2332a818579bbb24880f9d44715448a.tar.xz
glibc-5d8aa97da2332a818579bbb24880f9d44715448a.zip
time: Add 64-bit time_t support for ftime
It basically calls the 64-bit __clock_gettime64 and adds the overflow
check.

Checked on x86_64-linux-gnu and i686-linux-gnu.

Reviewed-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'include')
-rw-r--r--include/bits/types/struct_timeb.h1
-rw-r--r--include/struct___timeb64.h16
-rw-r--r--include/sys/timeb.h12
3 files changed, 29 insertions, 0 deletions
diff --git a/include/bits/types/struct_timeb.h b/include/bits/types/struct_timeb.h
new file mode 100644
index 0000000000..fef74d2f44
--- /dev/null
+++ b/include/bits/types/struct_timeb.h
@@ -0,0 +1 @@
+#include <time/bits/types/struct_timeb.h>
diff --git a/include/struct___timeb64.h b/include/struct___timeb64.h
new file mode 100644
index 0000000000..14704a9e30
--- /dev/null
+++ b/include/struct___timeb64.h
@@ -0,0 +1,16 @@
+#ifndef _STRUCT_TIMEB64_H
+#define _STRUCT_TIMEB64_H
+
+#if __TIMESIZE == 64
+# define __timeb64 timeb
+#else
+struct __timeb64
+{
+  __time64_t time;
+  unsigned short int millitm;
+  short int timezone;
+  short int dstflag;
+};
+#endif
+
+#endif /* _STRUCT_TIMEB64_H  */
diff --git a/include/sys/timeb.h b/include/sys/timeb.h
index 9f4509c35e..2b01dafea7 100644
--- a/include/sys/timeb.h
+++ b/include/sys/timeb.h
@@ -1 +1,13 @@
 #include <time/sys/timeb.h>
+
+#ifndef _ISOMAC
+# if __TIMESIZE == 64
+#  define __timeb64  timeb
+#  define __ftime64  ftime
+# else
+#  include <struct___timeb64.h>
+
+extern int __ftime64 (struct __timeb64 *) __nonnull ((1));
+libc_hidden_proto (__ftime64);
+# endif
+#endif