Eric Blake wrote: > POSIX says that such a call is implementation-defined, so technically, > mingw DOES implement the POSIX semantics (by defining that it is > unsupported).
Yes. So, code in freopen.c that would try to support a NULL argument in all cases - would be a gnulib extension, - would not be usable to change the read vs. write vs. append mode, because on many systems we would need to fiddle with FILE internals, which is hard and not reliable, - would be only useful to change the text vs. binary mode. But for this purpose gnulib already offers a simpler API: binary-io.h. > However, you are correct that it is annoying, and > something that gnulib could work around for easier coding. I don't agree. It's not easier coding to write xfreopen (NULL, "rb", fp); instead of SET_BINARY (fileno (fp)); Bruno