[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#353031: posix_fadvise defines missing



On Thu, Feb 16, 2006 at 12:24:27AM -0500, Greg Stark wrote:

> If this is intentional (which seems unlikely, why should I have to define
> these things just to get a standard libc function?) then it's at the very
> least a documentation bug. The man page clearly indicates that only "#include
> <fcntl.h>" is required.

Well, the man page says:

CONFORMING TO
	SUSv3 (Advanced Realtime Option), POSIX 1003.1-2003. [...]

And SUSv3 says:

"A POSIX-conforming application should ensure that the feature test macro
_POSIX_C_SOURCE is defined before inclusion of any header."

SUSv3 specifies that the value of _POSIX_C_SOURCE should be 200112L,
while the glibc documentation specifies that unless you explicitely
define a feature macro, the default value of _POSIX_C_SOURCE will be 2
(and thus posix_fadvise() will not be visible).

So it is documented behavior. And no, posix_fadvise is not "just a
standard libc function"; the only sane default for "standard" is what is
described in ISO C99, and that does not contain posix_fadvise().

Gabor

-- 
     ---------------------------------------------------------
     MTA SZTAKI Computer and Automation Research Institute
                Hungarian Academy of Sciences
     ---------------------------------------------------------



Reply to: