Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Aug 2023 08:44:39 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 273373] <sys/timerfd.h> fails to build in POSIX mode due to namespace pollution
Message-ID:  <bug-273373-227-yoi0HsNvfS@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-273373-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-273373-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273373

--- Comment #4 from Jan Beich <jbeich@FreeBSD.org> ---
Both attachment 244373 and review D41600?id=3D126574 are not self-sufficien=
t:

$ cat a.c
#include <sys/timerfd.h>
int main() { timerfd_create(CLOCK_MONOTONIC, 0); return 0; }

$ cc a.c
a.c:2:29: error: use of undeclared identifier 'CLOCK_MONOTONIC'
int main() { timerfd_create(CLOCK_MONOTONIC, 0); return 0; }
                            ^
1 error generated.

as found via www/chromium

../../third_party/wayland/src/src/event-loop.c:318:28: error: use of undecl=
ared
identifier 'CLOCK_MONOTONIC'
        timer_fd =3D timerfd_create(CLOCK_MONOTONIC,
                                  ^
../../third_party/wayland/src/src/event-loop.c:495:2: warning: call to
undeclared function 'clock_gettime'; ISO C99 and later do not support impli=
cit
function declarations [-Wimplicit-function-declaration]
        clock_gettime(CLOCK_MONOTONIC, &now);
        ^
../../third_party/wayland/src/src/event-loop.c:495:16: error: use of undecl=
ared
identifier 'CLOCK_MONOTONIC'
        clock_gettime(CLOCK_MONOTONIC, &now);
                      ^
../../third_party/wayland/src/src/event-loop.c:620:3: warning: call to
undeclared function 'clock_gettime'; ISO C99 and later do not support impli=
cit
function declarations [-Wimplicit-function-declaration]
                clock_gettime(CLOCK_MONOTONIC, &deadline);
                ^
../../third_party/wayland/src/src/event-loop.c:620:17: error: use of undecl=
ared
identifier 'CLOCK_MONOTONIC'
                clock_gettime(CLOCK_MONOTONIC, &deadline);
                              ^

Note, clock_gettime() is also affected due to namespace pollution in glibc/=
musl
where <sys/timerfd.h> includes <time.h>. On FreeBSD clock_gettime() was
provided via <sys/proc.h> -> <sys/time.h>.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-273373-227-yoi0HsNvfS>