On Mon, Mar 23, 2015 at 10:57:52AM +0100, Thomas Klausner wrote: > So, unless I get it wrong (I didn't read full specs :) both functions > are required in POSIX.1-2001 conforming stdio.h when _POSIX_C_SOURCE is > 200112L. Also, defining _POSIX_C_SOURCE is not optional.
I disagree on the second part. POSIX does *not* require it, but targets may choose a more restrictive set if it is not defined. That's a difference. > To use these functions in linux we need one of following macros to be defined: > _FILE_OFFSET_BITS == 64 || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 Correct, since they never managed to get their act together with 64bit off_t. > from NetBSD unistd.h (I hope I used correct version ...): > << > /* > * X/Open CAE Specification Issue 5 Version 2 > */ > #if (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE) > ssize_t pread(int, void *, size_t, off_t); > ssize_t pwrite(int, const void *, size_t, off_t); > #endif > >> > > This is POSIX.1-2001 conforming (but not POSIX.1-2008 conforming) > implementation of unistd.h Left over, noone did a full POSIX 2008 audit of the headers. Joerg