EWOULDBLOCK == EAGAIN in FreeBSD. Due to POSIX rules, though, if _POSIX_SOURCE is defined, we only define EAGAIN because _POSIX_SOURCE == POSIX_C_SOURCE=198808 which says 'don't define anything not in POSIX.1' and EWOULDBLOCK is not in POSIX.1. Otherwise is will be defines. is _POSIX_SOURCE being defined for some reason? [Edited to correct date of early posix]
Oh, and yes, E* defines are guaranteed to be macros in POSIX compliant environments. It's explicitly spelled out in at least Unix95(Issue 4) and newer as well as SVID versions.
Oh, and yes, E* defines are guaranteed to be macros in POSIX compliant environments. It's explicitly spelled out in at least Unix95 and newer as well as SVID versions.
We aren't supposed to define it if _POSIX_SOURCE is defined, since that's the language as it was in 1988, and EWOULDBLOCK isn't part of that. It wasn’t added until "Issue 4, Version 2" which was in 1995 around the time that the Open Group started minding the POSIX standard store... It might make sense to say #if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN since many implementations have them as the same value and some compilers like to warn about expressions that are apparently redundant like this....
Also, it's only newer versions of POSIX that define EWOULDBLOCK. I think 2008 issue 6 is where that's defined, but I've not done a full audit of the POSIX specs since it's the weekend...
EWOULDBLOCK == EAGAIN in FreeBSD. Due to POSIX rules, though, if _POSIX_SOURCE is defined, we only define EAGAIN because _POSIX_SOURCE == POSIX_C_SOURCE=199808 which says 'don't define anything not in POSIX.1' and EWOULDBLOCK is not in POSIX.1. Otherwise is will be defines. is _POSIX_SOURCE being defined for some reason?
EWOULDBLOCK == EAGAIN in FreeBSD. Due to POSIX rules, though, if _POSIX_SOURCE is defined, we only define EAGAIN because _POSIX_SOURCE == POSIX_C_SOURCE=199808 which says 'don't define anything not in POSIX.1' and EWOULDBLOCK is not in POSIX.1
shop-pdp.kent.edu has moved to shop-pdp.net