Index: include/time.h =================================================================== --- include/time.h +++ include/time.h @@ -207,9 +207,13 @@ #include #endif +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ + (defined(cplusplus) && cplusplus >= 201703) || \ + defined(__WANT_TIMESPEC_GET) /* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */ #define TIME_UTC 1 /* time elapsed since epoch */ int timespec_get(struct timespec *ts, int base); +#endif __END_DECLS Index: lib/libc/gen/timespec_get.c =================================================================== --- lib/libc/gen/timespec_get.c +++ lib/libc/gen/timespec_get.c @@ -33,6 +33,7 @@ __RCSID("$NetBSD: timespec_get.c,v 1.2 2016/10/04 12:48:15 christos Exp $"); __FBSDID("$FreeBSD$"); +#define __WANT_TIMESPEC_GET #include /* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */