Created attachment 64766 [details]
patch for oldish GNU C Library to have posix_fadvise() declared
In order to build 2.9.91 or later for (32- or 64-bit) Linux-x86, using the GNU C Library headers from the admittedly somewhat oldish version 2.3.6 I had to apply the attached patch. Without that patch the declaration of posix_fadvise() was missing.
Hm, it looks not correct to me. probably you should include feature.h and define _XOPEN_SOURCE or _POSIX_C_SOURCE with proper value instead if any.
You are absolutely right and and that is indeed what I tried first. To be precise I had passed 'CPPFLAGS=-D_XOPEN_SOURCE=600' to configure, but that didn't help.
<features.h> is already included automatically via <stdlib.h>.
Part of the problem clearly is that configure detects the function but does not realize the missing declaration. IMHO that is a weakness of your configure.ac.
Doing some experiments, I found that defining _GNU_SOURCE was the only thing that did help (e.g., via CPPFLAGS passed to configure).
(In reply to comment #2)
> Part of the problem clearly is that configure detects the function but does not
> realize the missing declaration. IMHO that is a weakness of your configure.ac.
Right. i'll try to improve it later.
> Doing some experiments, I found that defining _GNU_SOURCE was the only thing
> that did help (e.g., via CPPFLAGS passed to configure).
Okay, let me try. thanks for reporting.
Hm, apparently _POSIX_C_SOURCE is less than 200112L on older glibc, even though defining _XOPEN_SOURCE.
Having said that a hack is still needed to get things done though.
Proposed fix is in this tree:
Please test if it works for you.
Okay, confirmed the patch works with glibc 2.3.4, after clean up a bit. merged into master.