- Update findutils from 4.6.0 to 4.8.0 - Remove findutils-4.6.0-glibc2.28.patch from lfs as all patch items are now in the new tarball files. - Remove sed command on gl/lib/mountlist.c from lfs as all fixes are in the mountlist.c file in the new tarball. - Update rootfiles - Changelog Following are major changes. Further detailed info available in changelog file in tarball. * Noteworthy changes in release 4.8.0 (2021-01-09) [stable] ** Changes in xargs 'xargs -t' no longer outputs a trailing blank to stderr after the last argument of each constructed command line to be executed. [#57291] xargs now warns when more than one of the conflicting options --max-lines (-L, -l), --replace (-i/-I) and --max-args (-n) are specified on the command line. [#52137] ** Bug Fixes find no longer crashes when an XFS filesystem is heavily changed during the run. Discussed at: https://lists.gnu.org/r/bug-gnulib/2020-04/msg00068.html find -used works again. This predicate was not working properly since adding the support for sub-second timestamp resolution for various predicates in FINDUTILS_4_3_3-1 back in 2007. Discussed at: https://lists.gnu.org/r/bug-findutils/2019-11/msg00010.html ** Improvements 'find -D exec' now diagnoses all -exec, -execdir, -ok and -okdir runs including the call arguments and the exit code of the launched process. [#59083] ** Documentation Changes The documentation of 'find -printf %Ak' has been improved: it now refers to the strftime(3) documentation for a complete list of supported conversion specifiers, and documents the 'F' conversion specifier ('yyyy-mm-dd'). The man pages (find.1, locate.1, locatedb.5, updatedb.1, and xargs.1) now consistently end with the sections "REPORTING BUGS", "COPYRIGHT" and "SEE ALSO", with the latter referring to the online page on the GNU web server. The "EXAMPLES" section in the find.1 man page now shows the examples in a better structure and uses consistent formatting. Various man page fixes - syntax issues and typos. [#59745, #59330, #59012, #58193, #57807, #57775] Other documentation changes: #58654: doc: clarify that 'find -perm +MODE' is unrelated to umask #58458: doc: improve section 'Hard links', especially fix the description regarding 'find -L -samefile FILE'. #58205: find.1: clarify double dash '--' option #58149: 'xargs --help' now mentions that --replace (-I, -i) splits the input at newline characters. #57025: doc: enhance description of tests accepting numeric arguments in find.1 [see also #49640]. #54730: Add additional valuable example of find -quit #48135: Fix testsuite error on Hurd and BSD related to ln #35253: Clarify descriptions of -printf %f, %h. ** Changes to the build process The configure option --without-fts has been removed. The attempt to use it stopped configure with an error message since 4.5.18 (2015) anyway. * Major changes in release 4.7.0, 2019-08-29 ** Changes to locate / updatedb Support for generating old-format databases (with updatedb --old-format or updatedb --dbformat=old) has been removed. The old database format was deprecated in 2007 (and updatedb has warned about this since that time). The locate program will will read old-format databases, though this support also will be removed. The updatedb script now operates in the C locale only. This means that character encoding issues are now not likely to cause sort to fail. It also honours the TMPDIR environment variable if that was set, and no longer sorts file names case-insensitively. The (unspecified) order in which filenames are stored in the locate database is now different to previous versions. However, you should not rely on locate's output appearing in any particular order in any case. ** Improvements All utilities now only show the full usage text when requested via the --help option. Previously, when the user passed invalid options or arguments, the user's attention to the corresponding error diagnostic was distracted by that lengthy text. find now accepts multiple file type arguments to the -type and -xtype options separated by comma ','. For example, to search for symbolic links and directories simply provide the shorter '-type l,d' instead of the - yet more portable - '( -type l -o -type d )'. find now diagnoses failures returned by readdir(). This bug was inherent in the use of FTS. find now exits in more cases immediately after the error diagnostic, i.e., without the following usage text, to make the former more eye-catching. find now outputs a better hint in case the user passed an unquoted shell- glob pattern to options like -name, i.e., when the offending argument is an existing file. find now supports the debug option '-D all' to include all of the other debug options at once. xargs now supports the -o, --open-tty option to reopen stdin as /dev/tty in the child process before executing the command; useful to run an interactive application. Added for compatibility with BSD. xargs now supports the GNU_FINDUTILS_FD_LEAK_CHECK environment variable to enable/disable fd leak check. 'xargs -t' (--verbose) now properly quotes each part of the command to the executed if needed when printing it to stderr; likewise -p (--interactive). ** Documentation Changes Prefer https:// over http:// links where possible, e.g. for '*.gnu.org' servers. Both find.1 and the find texinfo manual now consistently document all of the 'N', 'L' and '?' possibilities in '-printf %Y' output when the determination of the type of a symlink target fails. find.1 now correctly states the -prune has no effect when the -depth option is given. Before, it wrongly stated that -prune would return false in that case. Some minor documentation improvements are listed in "Bug Fixes" below. ** Bug Fixes #56820: find: improve diagnostic when a global option like -maxdepth is specified after another argument like a test, thus hopefully avoiding translation issues (at least French, German). #56142: doc: fix bug #56142 by specifying which actions inhibit the default -print. #55272: find: improve diagnostic when -name or -iname is used with a pattern containing a directory separator ('/'), suggesting to use -wholename or -iwholename respectively. #54859: doc: fix typo in 'xargs -l' examples in texinfo manual. Change from 'xargs -1' (minus one) to 'xargs -l' (minus El) in 3 places. #54838: doc: fix the examples of the -perm option in the texinfo documentation. The example '-perm -g+w,o+w' was misplaced. Bug present since FINDUTILS_4_2_27-1. #54262: 'find -printf "%Y"' now correctly outputs 'N' for broken symlinks (ENOENT or ENOTDIR). Previously, it output 'l' in such a case. Bug introduced while attempting to fix #29460 in version v4.5.8. #54171: 'find -depth' now outputs the name of unreadable directories. Previously, FTS-based find missed to output those entries. Bug present since the FTS implementation in FINDUTILS_4_3_0-1. #52981: find: the '-delete' action no longer complains about disappeared files when the '-ignore_readdir_race' option is given, too. That action will also returns true in such a case now. #52220: 'find -D' without any further argument no longer crashes. Bug present since the implementation of -D in FINDUTILS_4_3_1-1. #51304: doc: use correct IEC unit prefixes in the documentation of 'find -size'. find(1) uses binary-based units for the suffixes 'k', 'M', and 'G' of the argument of the '-size' option: 1024, 1024*1024 and 1024^3. Therefore, the documentation should use the correct IEC prefixes kibibyte, mebibyte and gibibyte respectively (or their abbreviations 'KiB', 'MiB' and 'GiB'). #50758: doc: fix the description of the -perm examples matching the permission mode "022" in find's texinfo manual: the match is for the file's group and 'other' mode bits instead of for user and group. Bug introduced when adding the -perm examples in FINDUTILS-4.2.11. #50326: find no longer leaks memory for a recently added member in gnulib's mount list structure. #50259: find -printf '%h' now outputs the correct path for arguments with one or more trailing slashes. Previously, it would e.g. output "foo" instead of "." when "foo/" was passed; likewise, it would output "/user/xxx/" instead of "/user" when "/user/xxx//" was passed. Bug introduced in FINDUTILS-4.2.19. #48180: find -noop (an internal option not intended to be exposed to the user) no longer crashes. Bug introduced in FINDUTILS-4.3.1. #48030: find -exec + does not pass all arguments for certain specific filename lengths. After the internal (usually 128k) buffer is full and find(1) executed the given command with these arguments, it would miss to run the command yet another time if only one other file argument has to be processed. Bug introduced in FINDUTILS-4.2.12. #46784: frcode drops last char if no final newline ** Changes to the build process The configure option --enable-id-cache has been removed. It has been a no-op since findnutils-4.5.15. The configure option --enable-debug has been removed. Debugging in find is now controlled by its -D option only. The configure option --enable-silent-rules is the default now. Use --disable-silent-rules or "make V=1" to get verbose build output. "make dist" no longer builds .tar.gz files. xz is portable enough and in wide-enough use that distributing only .tar.xz files is enough. Maintainer builds from the Git repository now derive the version string from the version control system instead of using a fixed string (changed after each release manually). As a result, the inter-release builds can now be distinguished: e.g. "4.6.0.152-fe9c" is the 152th commit after the tag "v4.6.0" and has the Git short hash "fe9c". Builds from an unclean tree are marked with the suffix "-dirty". The translation files in the PO directory are no longer version controlled; instead bootstrap auto-updates them from "translationproject.org" during a maintainer build. A shell-style test framework borrowed from GNU coreutils has been added. This allows better tests with more control over stdin, stdout, stderr, signals, preparatory steps, cleanup, return code verification, root-only tests, etc.
Signed-off-by: Adolf Belka adolf.belka@ipfire.org --- config/rootfiles/common/findutils | 3 - lfs/findutils | 15 +- src/patches/findutils-4.6.0-glibc2.28.patch | 335 -------------------- 3 files changed, 4 insertions(+), 349 deletions(-) delete mode 100644 src/patches/findutils-4.6.0-glibc2.28.patch
diff --git a/config/rootfiles/common/findutils b/config/rootfiles/common/findutils index edb91a9bf..d9f9ad0b6 100644 --- a/config/rootfiles/common/findutils +++ b/config/rootfiles/common/findutils @@ -5,8 +5,6 @@ usr/bin/locate usr/bin/updatedb usr/bin/xargs #usr/lib/findutils -usr/lib/findutils/bigram -usr/lib/findutils/code usr/lib/findutils/frcode #usr/share/info/find-maint.info #usr/share/info/find.info @@ -17,4 +15,3 @@ usr/lib/findutils/frcode #usr/share/man/man1/updatedb.1 #usr/share/man/man1/xargs.1 #usr/share/man/man5/locatedb.5 -var/lib/locate diff --git a/lfs/findutils b/lfs/findutils index 1ec69c99a..0b2753dc1 100644 --- a/lfs/findutils +++ b/lfs/findutils @@ -24,10 +24,10 @@
include Config
-VER = 4.6.0 +VER = 4.8.0
THISAPP = findutils-$(VER) -DL_FILE = $(THISAPP).tar.gz +DL_FILE = $(THISAPP).tar.xz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP)
@@ -50,7 +50,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 9936aa8009438ce185bea2694a997fc1 +$(DL_FILE)_MD5 = eeefe2e6380931a77dfa6d9350b43186
install : $(TARGET)
@@ -79,14 +79,7 @@ $(subst %,%_MD5,$(objects)) :
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) - @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) - - # Newer C libraries omit this include from sys/types.h. - # https://lists.gnu.org/archive/html/bug-gnulib/2016-03/msg00018.html - cd $(DIR_APP) && sed -i gl/lib/mountlist.c \ - -e "/include.*config.h/a#ifdef MAJOR_IN_SYSMACROS\n#include <sys/sysmacros.h>\n#endif\n" - - cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/findutils-4.6.0-glibc2.28.patch + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) cd $(DIR_APP) && ./configure $(EXTRA_CONFIG) cd $(DIR_APP) && make $(MAKETUNING) cd $(DIR_APP) && make install diff --git a/src/patches/findutils-4.6.0-glibc2.28.patch b/src/patches/findutils-4.6.0-glibc2.28.patch deleted file mode 100644 index 651c2d265..000000000 --- a/src/patches/findutils-4.6.0-glibc2.28.patch +++ /dev/null @@ -1,335 +0,0 @@ -Fix build failure on glibc-2.28: - fseeko.c: In function 'rpl_fseeko': - fseeko.c:110:4: error: #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib." - #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib." - -Patch by milan hodoscek. - -https://bugs.gentoo.org/663242 ---- a/old/stdio-impl.h -+++ b/gl/lib/stdio-impl.h -@@ -1,5 +1,5 @@ - /* Implementation details of FILE streams. -- Copyright (C) 2007-2008, 2010-2015 Free Software Foundation, Inc. -+ Copyright (C) 2007-2008, 2010-2018 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by -@@ -12,12 +12,18 @@ - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License -- along with this program. If not, see http://www.gnu.org/licenses/. */ -+ along with this program. If not, see https://www.gnu.org/licenses/. */ - - /* Many stdio implementations have the same logic and therefore can share - the same implementation of stdio extension API, except that some fields - have different naming conventions, or their access requires some casts. */ - -+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this -+ problem by defining it ourselves. FIXME: Do not rely on glibc -+ internals. */ -+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN -+# define _IO_IN_BACKUP 0x100 -+#endif - - /* BSD stdio derived implementations. */ - -@@ -29,10 +35,10 @@ - #include <errno.h> /* For detecting Plan9. */ - - #if defined __sferror || defined __DragonFly__ || defined __ANDROID__ -- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ -+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ - - # if defined __DragonFly__ /* DragonFly */ -- /* See http://www.dragonflybsd.org/cvsweb/src/lib/libc/stdio/priv_stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup. */ -+ /* See https://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/lib/libc/stdio/priv_stdio.h. */ - # define fp_ ((struct { struct __FILE_public pub; \ - struct { unsigned char *_base; int _size; } _bf; \ - void *cookie; \ -@@ -49,30 +55,84 @@ - fpos_t _offset; \ - /* More fields, not relevant here. */ \ - } *) fp) -- /* See http://www.dragonflybsd.org/cvsweb/src/include/stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup. */ -+ /* See https://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/include/stdio.h. */ - # define _p pub._p - # define _flags pub._flags - # define _r pub._r - # define _w pub._w -+# elif defined __ANDROID__ /* Android */ -+ /* Up to this commit from 2015-10-12 -+ https://android.googlesource.com/platform/bionic.git/+/f0141dfab10a4b332769d52fa76631a64741297a -+ the innards of FILE were public, and fp_ub could be defined like for OpenBSD, -+ see https://android.googlesource.com/platform/bionic.git/+/e78392637d5086384a5631ddfdfa8d7ec8326ee3/libc/stdio/fileext.h -+ and https://android.googlesource.com/platform/bionic.git/+/e78392637d5086384a5631ddfdfa8d7ec8326ee3/libc/stdio/local.h. -+ After this commit, the innards of FILE are hidden. */ -+# define fp_ ((struct { unsigned char *_p; \ -+ int _r; \ -+ int _w; \ -+ int _flags; \ -+ int _file; \ -+ struct { unsigned char *_base; size_t _size; } _bf; \ -+ int _lbfsize; \ -+ void *_cookie; \ -+ void *_close; \ -+ void *_read; \ -+ void *_seek; \ -+ void *_write; \ -+ struct { unsigned char *_base; size_t _size; } _ext; \ -+ unsigned char *_up; \ -+ int _ur; \ -+ unsigned char _ubuf[3]; \ -+ unsigned char _nbuf[1]; \ -+ struct { unsigned char *_base; size_t _size; } _lb; \ -+ int _blksize; \ -+ fpos_t _offset; \ -+ /* More fields, not relevant here. */ \ -+ } *) fp) - # else - # define fp_ fp - # endif - --# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __ANDROID__ /* NetBSD >= 1.5ZA, OpenBSD, Android */ -+# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __minix /* NetBSD >= 1.5ZA, OpenBSD, Minix 3 */ - /* See http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup -- and http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup */ -+ and https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup -+ and https://github.com/Stichting-MINIX-Research-Foundation/minix/blob/master/lib/libc/stdio/fileext.h */ - struct __sfileext - { - struct __sbuf _ub; /* ungetc buffer */ - /* More fields, not relevant here. */ - }; - # define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub --# else /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin, Android */ -+# elif defined __ANDROID__ /* Android */ -+ struct __sfileext -+ { -+ struct { unsigned char *_base; size_t _size; } _ub; /* ungetc buffer */ -+ /* More fields, not relevant here. */ -+ }; -+# define fp_ub ((struct __sfileext *) fp_->_ext._base)->_ub -+# else /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin */ - # define fp_ub fp_->_ub - # endif - - # define HASUB(fp) (fp_ub._base != NULL) - -+# if defined __ANDROID__ /* Android */ -+ /* Needed after this commit from 2016-01-25 -+ https://android.googlesource.com/platform/bionic.git/+/e70e0e9267d069bf56a5078c99307e08a7280de7 */ -+# ifndef __SEOF -+# define __SLBF 1 -+# define __SNBF 2 -+# define __SRD 4 -+# define __SWR 8 -+# define __SRW 0x10 -+# define __SEOF 0x20 -+# define __SERR 0x40 -+# endif -+# ifndef __SOFF -+# define __SOFF 0x1000 -+# endif -+# endif -+ - #endif - - -@@ -81,7 +141,7 @@ - #ifdef __TANDEM /* NonStop Kernel */ - # ifndef _IOERR - /* These values were determined by the program 'stdioext-flags' at -- http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00165.html. */ -+ https://lists.gnu.org/r/bug-gnulib/2010-12/msg00165.html. */ - # define _IOERR 0x40 - # define _IOREAD 0x80 - # define _IOWRT 0x4 -@@ -99,6 +159,8 @@ - int _file; \ - unsigned int _flag; \ - } *) fp) -+# elif defined __VMS /* OpenVMS */ -+# define fp_ ((struct _iobuf *) fp) - # else - # define fp_ fp - # endif -@@ -110,4 +172,31 @@ - # define _flag __flag - # endif - -+#elif defined _WIN32 && ! defined __CYGWIN__ /* newer Windows with MSVC */ -+ -+/* <stdio.h> does not define the innards of FILE any more. */ -+# define WINDOWS_OPAQUE_FILE -+ -+struct _gl_real_FILE -+{ -+ /* Note: Compared to older Windows and to mingw, it has the fields -+ _base and _cnt swapped. */ -+ unsigned char *_ptr; -+ unsigned char *_base; -+ int _cnt; -+ int _flag; -+ int _file; -+ int _charbuf; -+ int _bufsiz; -+}; -+# define fp_ ((struct _gl_real_FILE *) fp) -+ -+/* These values were determined by a program similar to the one at -+ https://lists.gnu.org/r/bug-gnulib/2010-12/msg00165.html. */ -+# define _IOREAD 0x1 -+# define _IOWRT 0x2 -+# define _IORW 0x4 -+# define _IOEOF 0x8 -+# define _IOERR 0x10 -+ - #endif ---- a/old/fseeko.c -+++ b/gl/lib/fseeko.c -@@ -1,5 +1,5 @@ - /* An fseeko() function that, together with fflush(), is POSIX compliant. -- Copyright (C) 2007-2015 Free Software Foundation, Inc. -+ Copyright (C) 2007-2018 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by -@@ -12,7 +12,7 @@ - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along -- with this program; if not, see http://www.gnu.org/licenses/. */ -+ with this program; if not, see https://www.gnu.org/licenses/. */ - - #include <config.h> - -@@ -33,9 +33,9 @@ fseeko (FILE *fp, off_t offset, int whence) - #endif - #if _GL_WINDOWS_64_BIT_OFF_T - # undef fseeko --# if HAVE__FSEEKI64 /* msvc, mingw64 */ -+# if HAVE__FSEEKI64 && HAVE_DECL__FSEEKI64 /* msvc, mingw since msvcrt8.0, mingw64 */ - # define fseeko _fseeki64 --# else /* mingw */ -+# else /* mingw before msvcrt8.0 */ - # define fseeko fseeko64 - # endif - #endif -@@ -47,12 +47,13 @@ fseeko (FILE *fp, off_t offset, int whence) - #endif - - /* These tests are based on fpurge.c. */ --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 -+ /* GNU libc, BeOS, Haiku, Linux libc5 */ - if (fp->_IO_read_end == fp->_IO_read_ptr - && fp->_IO_write_ptr == fp->_IO_write_base - && fp->_IO_save_base == NULL) - #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ -- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ -+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ - # if defined __SL64 && defined __SCLE /* Cygwin */ - if ((fp->_flags & __SL64) == 0) - { -@@ -80,7 +81,7 @@ fseeko (FILE *fp, off_t offset, int whence) - #elif defined __minix /* Minix */ - if (fp_->_ptr == fp_->_buf - && (fp_->_ptr == NULL || fp_->_count == 0)) --#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */ -+#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */ - if (fp_->_ptr == fp_->_base - && (fp_->_ptr == NULL || fp_->_cnt == 0)) - #elif defined __UCLIBC__ /* uClibc */ -@@ -117,18 +118,19 @@ fseeko (FILE *fp, off_t offset, int whence) - if (pos == -1) - { - #if defined __sferror || defined __DragonFly__ || defined __ANDROID__ -- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ -+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ - fp_->_flags &= ~__SOFF; - #endif - return -1; - } - --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 -+ /* GNU libc, BeOS, Haiku, Linux libc5 */ - fp->_flags &= ~_IO_EOF_SEEN; - fp->_offset = pos; - #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ -- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ --# if defined __CYGWIN__ || (defined __NetBSD__ && __NetBSD_Version__ >= 600000000) -+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ -+# if defined __CYGWIN__ || (defined __NetBSD__ && __NetBSD_Version__ >= 600000000) || defined __minix - /* fp_->_offset is typed as an integer. */ - fp_->_offset = pos; - # else -@@ -150,8 +152,8 @@ fseeko (FILE *fp, off_t offset, int whence) - fp_->_flags &= ~__SEOF; - #elif defined __EMX__ /* emx+gcc */ - fp->_flags &= ~_IOEOF; --#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */ -- fp->_flag &= ~_IOEOF; -+#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */ -+ fp_->_flag &= ~_IOEOF; - #elif defined __MINT__ /* Atari FreeMiNT */ - fp->__offset = pos; - fp->__eof = 0; ---- a/old/freadahead.c -+++ b/gl/lib/freadahead.c -@@ -1,5 +1,5 @@ - /* Retrieve information about a FILE stream. -- Copyright (C) 2007-2015 Free Software Foundation, Inc. -+ Copyright (C) 2007-2018 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by -@@ -12,7 +12,7 @@ - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License -- along with this program. If not, see http://www.gnu.org/licenses/. */ -+ along with this program. If not, see https://www.gnu.org/licenses/. */ - - #include <config.h> - -@@ -22,17 +22,26 @@ - #include <stdlib.h> - #include "stdio-impl.h" - -+#if defined __DragonFly__ -+/* Defined in libc, but not declared in <stdio.h>. */ -+extern size_t __sreadahead (FILE *); -+#endif -+ -+/* This file is not used on systems that have the __freadahead function, -+ namely musl libc. */ -+ - size_t - freadahead (FILE *fp) - { --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 -+ /* GNU libc, BeOS, Haiku, Linux libc5 */ - if (fp->_IO_write_ptr > fp->_IO_write_base) - return 0; - return (fp->_IO_read_end - fp->_IO_read_ptr) - + (fp->_flags & _IO_IN_BACKUP ? fp->_IO_save_end - fp->_IO_save_base : - 0); - #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ -- /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ -+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ - if ((fp_->_flags & __SWR) != 0 || fp_->_r < 0) - return 0; - # if defined __DragonFly__ -@@ -53,7 +62,7 @@ freadahead (FILE *fp) - if ((fp_->_flags & _IOWRITING) != 0) - return 0; - return fp_->_count; --#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */ -+#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */ - if ((fp_->_flag & _IOWRT) != 0) - return 0; - return fp_->_cnt;