[Bug 247701] CLOCK_REALTIME is not visible when _XOPEN_SOURCE == 500 or _POSIX_C_SOURCE == 199506

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Jul 2 01:33:32 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247701

            Bug ID: 247701
           Summary: CLOCK_REALTIME is not visible when _XOPEN_SOURCE ==
                    500 or _POSIX_C_SOURCE == 199506
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: standards
          Assignee: standards at FreeBSD.org
          Reporter: jbeich at FreeBSD.org

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

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-standards mailing list