1diff -r -U3 coreutils-6.10/lib/freadahead.c coreutils-6.10-patched/lib/freadahead.c
2--- coreutils-6.10/lib/freadahead.c	2007-11-08 00:32:20.000000000 -0700
3+++ coreutils-6.10-patched/lib/freadahead.c	2019-08-01 20:09:03.731243826 -0600
4@@ -22,7 +22,7 @@
5 size_t
6 freadahead (FILE *fp)
7 {
8-#if defined _IO_ferror_unlocked     /* GNU libc, BeOS */
9+#if defined _IO_EOF_SEEN || defined _IO_ferror_unlocked     /* GNU libc, BeOS */
10   if (fp->_IO_write_ptr > fp->_IO_write_base)
11     return 0;
12   return fp->_IO_read_end - fp->_IO_read_ptr;
13diff -r -U3 coreutils-6.10/lib/fseterr.c coreutils-6.10-patched/lib/fseterr.c
14--- coreutils-6.10/lib/fseterr.c	2007-11-08 00:32:20.000000000 -0700
15+++ coreutils-6.10-patched/lib/fseterr.c	2019-08-01 20:09:16.407416594 -0600
16@@ -27,7 +27,7 @@
17   /* Most systems provide FILE as a struct and the necessary bitmask in
18      <stdio.h>, because they need it for implementing getc() and putc() as
19      fast macros.  */
20-#if defined _IO_ferror_unlocked     /* GNU libc, BeOS */
21+#if defined _IO_EOF_SEEN || defined _IO_ferror_unlocked     /* GNU libc, BeOS */
22   fp->_flags |= _IO_ERR_SEEN;
23 #elif defined __sferror             /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
24   fp->_flags |= __SERR;
25