4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-18 23:12:15 +08:00

Cygwin: timespec_get: implement C11 function

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2024-02-16 20:44:31 +01:00
parent f9542a2e8e
commit a7bf7c7dd5
4 changed files with 18 additions and 0 deletions

View 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

View 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

View File

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

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