Browse Source

Cygwin: timespec_get: implement C11 function

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
master
Corinna Vinschen 2 years ago
parent
commit
a7bf7c7dd5
  1. 1
      winsup/cygwin/cygwin.din
  2. 6
      winsup/cygwin/include/cygwin/time.h
  3. 2
      winsup/cygwin/release/3.6.0
  4. 9
      winsup/cygwin/times.cc

1
winsup/cygwin/cygwin.din

@ -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

6
winsup/cygwin/include/cygwin/time.h

@ -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

2
winsup/cygwin/release/3.6.0

@ -7,6 +7,8 @@ What's new:
- New API call: setproctitle.
- New API call: timespec_get.
What changed:
-------------

9
winsup/cygwin/times.cc

@ -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;
}

Loading…
Cancel
Save