When old POSIX conformance is requested FreeBSD for some reason hides CLOCK_REALTIME to a later version. Issue 7: https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getres.html https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html Issue 5: https://pubs.opengroup.org/onlinepubs/007908799/xsh/clock_settime.html https://pubs.opengroup.org/onlinepubs/007908799/xsh/time.h.html $ cc a.c a.c:7:17: error: use of undeclared identifier 'CLOCK_REALTIME' clock_gettime(CLOCK_REALTIME, &tp); ^ 1 error generated. $ cat a.c #define _XOPEN_SOURCE 500 #include <time.h> int main() { struct timespec tp; clock_gettime(CLOCK_REALTIME, &tp); return 0; }
https://reviews.freebsd.org/D25554
A commit references this bug: Author: kib Date: Tue Jul 14 20:23:28 UTC 2020 New revision: 363193 URL: https://svnweb.freebsd.org/changeset/base/363193 Log: Make CLOCK_REALTIME and TIMER_ABSTIME available for XOPEN_SOURCE >= 500. Reported by: jbeich PR: 247701 Reviewed by: jilles Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25554 Changes: head/include/time.h head/sys/sys/time.h
A commit references this bug: Author: kib Date: Tue Jul 21 08:12:53 UTC 2020 New revision: 363385 URL: https://svnweb.freebsd.org/changeset/base/363385 Log: MFC r363193: Make CLOCK_REALTIME and TIMER_ABSTIME available for XOPEN_SOURCE >= 500. PR: 247701 Changes: _U stable/12/ stable/12/include/time.h stable/12/sys/sys/time.h
A commit references this bug: Author: kib Date: Tue Jul 21 08:13:35 UTC 2020 New revision: 363386 URL: https://svnweb.freebsd.org/changeset/base/363386 Log: MFC r363193: Make CLOCK_REALTIME and TIMER_ABSTIME available for XOPEN_SOURCE >= 500. PR: 247701 Changes: _U stable/11/ stable/11/include/time.h stable/11/sys/sys/time.h