]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: timespec_get: implement C11 function
authorCorinna Vinschen <corinna@vinschen.de>
Fri, 16 Feb 2024 19:44:31 +0000 (20:44 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Fri, 16 Feb 2024 19:44:31 +0000 (20:44 +0100)
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/cygwin.din
winsup/cygwin/include/cygwin/time.h
winsup/cygwin/release/3.6.0
winsup/cygwin/times.cc

index be9efdc00f44dc04988cdd8ed0478c09bd6c570f..37ec00896232998ca613a5a9877c1962f1621ce1 100644 (file)
@@ -1559,6 +1559,7 @@ timerfd_create SIGFE
 timerfd_gettime SIGFE
 timerfd_settime SIGFE
 times SIGFE
+timespec_get SIGFE
 timezone SIGFE
 timingsafe_bcmp NOSIGFE
 timingsafe_memcmp NOSIGFE
index d7f9d3f75b156d14993639a9bedc013b3bd77a79..9b63e9aeb6cef65001ccc6aae3f2e4d357769abe 100644 (file)
@@ -35,6 +35,12 @@ extern long timezone __asm__ (_SYMSTR (_timezone));
 
 #endif /* __SVID_VISIBLE || __XSI_VISIBLE */
 
+#if __ISO_C_VISIBLE >= 2011
+#define TIME_UTC 1
+
+extern int timespec_get (struct timespec *, int);
+#endif
+
 #ifdef __cplusplus
 }
 #endif
index 561637c397e6861ed7b427055d6ec95d62bdc518..e190aa2927d6bd7e903f284b5340e79006b90ced 100644 (file)
@@ -7,6 +7,8 @@ What's new:
 
 - New API call: setproctitle.
 
+- New API call: timespec_get.
+
 
 What changed:
 -------------
index ddea061b8920cd9b01a3f2db1ecf3ed791b55f15..87773934bfd778c84688133c9e27d6beb4bab8a8 100644 (file)
@@ -559,3 +559,12 @@ clock_getcpuclockid (pid_t pid, clockid_t *clk_id)
   *clk_id = (clockid_t) PID_TO_CLOCKID (pid);
   return 0;
 }
+
+extern "C" int
+timespec_get (struct timespec *ts, int base)
+{
+  if (base != TIME_UTC)
+    return 0;
+  clock_gettime (CLOCK_REALTIME, ts);
+  return base;
+}
This page took 0.038284 seconds and 5 git commands to generate.