Closed dryeo closed 1 year ago
What makes you think these guards should be removed? These errors are not part of POSIX (see https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html) and that's why they only show up when POSIX is not defined. FreeBSD (which our LIBC is significantly based on) does exactly the same thing (https://github.com/freebsd/freebsd-src/blob/master/sys/sys/errno.h) and I see no reason to change it.
As for mpg123, its compile or link options should be aligned I guess.
Feel free to reopen if you have strong objections.
Well, EWOULDBLOCK seems to be an exception here as POSIX lists it as "shall define" on the page above. I wonder why FreeBSD goes this way and hides it then. There is also ETXTBSY with the same story and perhaps some more. Ok, I will check them all.
Building mpg123's latest snapshot results in this error,
and looking at sys/errno.h around line 112 shows,
There are also other #ifndef _POSIX_SOURCE guards in the header. One man page has,
So this seems like a bug to me and the guards should be removed. I can make a patch if needed. If there is a good reason for these guards, it would also be good to document it in the header