https://github.com/apple/cups/issues/5396 https://github.com/OpenPrinting/cups-filters/issues/58 File I/O seems to be fine with the patch but pipes as set up by CUPS are not. We have printers that won't print and a test program that doesn't produce the expected output.
While double-checking whether we reset _IO_EOF_SEEN in the required places, I found this: fp->_IO_read_end += count; if (count == 0) { /* If a stream is read to EOF, the calling application may switch active handles. As a result, our offset cache would no longer be valid, so unset it. */ fp->_offset = _IO_pos_BAD; return EOF; } So there was once an expectation that you replace the underlying descriptor (with dup2) after reaching EOF, and this is what cups-filters is doing. Unfortunately, this extension breaks POSIX compliance in other cases (bug 1190).
More concretely: My concern is that as the source comment above implies, we used to support concatenating multiple files (or pipes) into the same stdio stream using dup2, as an extension over POSIX. The fix for bug 1190 removed that extension, breaking existing software.
Mailing list discussion: https://sourceware.org/ml/libc-alpha/2018-09/msg00235.html Consensus seems to be that glibc should not change.