aboutsummaryrefslogtreecommitdiff
path: root/include/time.h
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-03-02 09:02:02 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-06-15 10:42:11 -0300
commit8af344feb5ae3e6e3374a6cf2175b44cc904a94e (patch)
treed10bf6233515a791dcf9bcb3d764d61c965a0008 /include/time.h
parent7446e896334cdb5431997dcc30d7ca13768b467d (diff)
downloadglibc-8af344feb5ae3e6e3374a6cf2175b44cc904a94e.zip
glibc-8af344feb5ae3e6e3374a6cf2175b44cc904a94e.tar.gz
glibc-8af344feb5ae3e6e3374a6cf2175b44cc904a94e.tar.bz2
time: Add 64-bit time support for getdate
The getdate is basically a wrapper localtime and mktime. The 64-bit time support is done calling the 64-bit internal functions, there is no need to add a new symbol version. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'include/time.h')
-rw-r--r--include/time.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/time.h b/include/time.h
index 4372bfb..980c6bd 100644
--- a/include/time.h
+++ b/include/time.h
@@ -283,8 +283,8 @@ hidden_proto (__nanosleep64)
#endif
-extern int __getdate_r (const char *__string, struct tm *__resbufp)
- attribute_hidden;
+extern int __getdate_r (const char *__string, struct tm *__resbufp);
+libc_hidden_proto (__getdate_r);
/* Determine CLK_TCK value. */
@@ -509,6 +509,14 @@ time_now (void)
return ts.tv_sec;
}
+static inline __time64_t
+time64_now (void)
+{
+ struct __timespec64 ts;
+ __clock_gettime64 (TIME_CLOCK_GETTIME_CLOCKID, &ts);
+ return ts.tv_sec;
+}
+
#define NSEC_PER_SEC 1000000000L /* Nanoseconds per second. */
#define USEC_PER_SEC 1000000L /* Microseconds per second. */
#define NSEC_PER_USEC 1000L /* Nanoseconds per microsecond. */