Using __ppoll64 internally
Cristian Rodríguez
crrodriguez@opensuse.org
Fri Sep 10 01:50:09 GMT 2021
On Thu, Sep 9, 2021 at 4:18 PM Florian Weimer <fweimer@redhat.com> wrote:
> So you need to provide more details about your build environment, and
> more of the warning message. There should be a location of the use of
> the macro.
I will exemplify then with the problematic
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 9f86f5fe47..ce612bd55c 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -927,9 +926,8 @@ send_dg(res_state statp,
{
const HEADER *hp = (HEADER *) buf;
const HEADER *hp2 = (HEADER *) buf2;
- struct timespec now, timeout, finish;
+ struct __timespec64 now, timeout, finish;
struct pollfd pfd[1];
- int ptimeout;
struct sockaddr_in6 from;
int resplen = 0;
int n;
@@ -979,14 +977,11 @@ send_dg(res_state statp,
evSubTime(&timeout, &finish, &now);
need_recompute = 0;
}
- /* Convert struct timespec in milliseconds. */
- ptimeout = timeout.tv_sec * 1000 + timeout.tv_nsec / 1000000;
-
n = 0;
if (nwritten == 0)
n = __poll (pfd, 1, 0);
if (__glibc_unlikely (n == 0)) {
- n = __poll (pfd, 1, ptimeout);
+ n = __ppoll64 (pfd, 1, &timeout, NULL);
need_recompute = 1;
}
if (n == 0) {
Here using __ppoll64 should be valid, as it is the correct function
that takes an struct __timespec64 as timeout parameter.
It is indeed a valid callable function but it is #define'd in the
headers to a symbol that is nowhere to be declared.
More information about the Libc-alpha
mailing list