diff --git a/ChangeLog b/ChangeLog index 5c845b0b250c8940580e5eb190342bde4be034d8..51501724b6e1cdc2bd3c52eb7ef700d0ed964c31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,620 @@ +2019-02-23 Sergey Poznyakoff + + Version 1.32 + +2019-02-04 Sergey Poznyakoff + + Minor fixes in docs. + + * doc/tar.1: Remove description of the --preserve option + Document verbosity levels. + * doc/tar.texi: Fix description of the -o option. + +2019-01-15 Daniel Le + + Fix typos in the documentation + + Short option "t" was mistranslated to "--test" instead of "--list" + in commit + 67cad0792b4e6cf22c6cb1b167b149cd176d49f9. + +2019-01-15 Sergey Poznyakoff + + Fix build on AIX + + * src/unlink.c (flush_deferred_unlinks): Avoid possible duplicate + case + (if ENOTEMPTY==EEXIST) + +2019-01-15 Sergey Poznyakoff + + Version 1.31.90 + +2019-01-14 Sergey Poznyakoff + + Ensure gnu format when running checkpoint tests + +2019-01-14 Sergey Poznyakoff + + Fix compression tests + + Existing compression tests used tar with compiled-in + defaults. However, + some of the defaults are sure to create archives that are not + byte-to-byte + reproducible (e.g. DEFAULT_ARCHIVE_FORMAT=POSIX, because the + name field + in posix extended headers uses PID of the creating process + by default). + Moreover, some compressors (e.g. gzip) store current timestamp in + the file header when compressing from stdin, so that using cmp + on the + two created archives as the tests did is error-prone. Another + problem + is that the tests implicitly assumed that tar uses archive + suffix to + recognize its format when extracting, which isn't the + case. Finally, + there's hardly any reason in using sed to create m4 sources, when + everything can be achieved by m4 itself. + + * tests/Makefile.am: Remove generation of compress-*.at files. + * tests/compress.at.in: Remove. + * tests/compress.m4: New file. + * tests/testsuite.at: Include compress.m4, use TAR_CHECK_COMPRESS + to + check compression options. + +2019-01-14 Sergey Poznyakoff + + Fix possible NULL dereference (savannah bug #55369) + + * src/sparse.c (pax_decode_header): Check return from + find_next_block. + +2019-01-14 Sergey Poznyakoff + + Fix compilation without iconv. + +2019-01-14 Sergey Poznyakoff + + Fix iconv usage. + + Patch by Christian Weisgerber. + + * src/utf8.c (utf8_convert): non-zero return from iconv means + failure. + +2019-01-14 Pavel Raiskup + + tests: fix numeric.at for BSD + + While creating file, BSD kernels inherit the group ownership from + parent directory. + http://lists.gnu.org/archive/html/bug-tar/2016-06/msg00000.html + + * tests/numeric.at: Attempt to 'chown' the newly created directory + to proper group (at least on affected machines that command is + expected to succeed). + +2019-01-14 Sergey Poznyakoff + + Fix typo in manpage. + +2019-01-14 Sergey Poznyakoff + + Fix expected output in dirrem tests. + + In both tests, the "file changed as we read it" warning might be + produced for dir/sub, depending on the ctime resolution and + timing. + The problem was fixed by 64b43fdf70d82c39eb2ca900cd4f8e49, + but regressed + after e7cd377f7801d42aa8e07addff93d2150666c237, which removed + 1 second + delays between each pair of checkpoints. Since the presense + or absense + of this warning is irrelevant for the test, it is now suppressed. + + * tests/dirrem01.at: Suppress the file-changed warning. + * tests/dirrem02.at: Likewise. + +2019-01-12 Sergey Poznyakoff + + Fix the use of --checkpoint without explicit --checkpoint-action + + * src/checkpoint.c (checkpoint_finish_compile): Set default + action, + if necessary. + * tests/checkpoint/defaults.at: New testcase. + * tests/checkpoint/dot-compat.at: New testcase. + * tests/checkpoint/dot-int.at: New testcase. + * tests/checkpoint/dot.at: New testcase. + * tests/checkpoint/interval.at: New testcase. + * tests/Makefile.am: Add new testcases. + * tests/testsuite.at Include new testcases. + +2019-01-10 Sergey Poznyakoff + + Remove erroneous abort() call + + The call was introduced by commit ccef8581. It caused tar to abort + on perfectly normal operations, like untarring archives containing + ./ with the -U option, + + See + http://lists.gnu.org/archive/html/bug-tar/2019-01/msg00019.html + for details. + + * src/extract.c (maybe_recoverable): Remove misplaced call + to abort(). + +2019-01-02 Sergey Poznyakoff + + Version 1.31 + +2018-12-28 Sergey Poznyakoff + + Fix the difflink test + + Hardlinking a symlink produces hardlink on BSD and symlink + on GNU/Linux. Avoid the ambiguity. + + * tests/difflink.at: Create hard link from a regular file. + +2018-12-28 Sergey Poznyakoff + + Work over a bug in gnulib error() + + The error() function from glibc correctly prefixes each message it + prints with program_name as set by set_program_name. However, its + replacement from gnulib, which is linked in on systems where this + function is not available, prints the name returned by + getprogname() + instead. Due to this messages output by tar subprocess (which + sets its + program name to 'tar (child)') become indiscernible from those + printed + by the main process. In particular, this breaks the remfiles01.at + and + remfiles02.at test cases. + + * configure.ac: Define ENABLE_ERROR_PRINT_PROGNAME if using + gnulib error(). + * src/tar.c [ENABLE_ERROR_PRINT_PROGNAME] (tar_print_progname): + New function. + (main) [ENABLE_ERROR_PRINT_PROGNAME]: Set error_print_progname. + +2018-12-28 Sergey Poznyakoff + + Implement the "wait" checkpoint action. + + This action instructs tar to pause until given signal is + delivered. + The newer genfile tool uses this action for communication between + genfile and tar in exec mode. This eliminates race conitions and + speeds up the tests based on exec mode. + + * doc/tar.texi: Document changes. + * paxutils: Upgrade. + * src/checkpoint.c: Implement the wait action. + * src/common.h (decode_signal): New proto. + * src/tar.c (decode_signal): New function. + (set_stat_signal): Rewrite. + * tests/dirrem01.at: Adjust genfile and tar command line arguments + to use the new feature. + * tests/dirrem02.at: Likewise. + * tests/filerem01.at: Likewise. + * tests/filerem02.at: Likewise. + * tests/grow.at: Likewise. + * tests/sptrcreat.at: Likewise. + * tests/sptrdiff00.at: Likewise. + * tests/sptrdiff01.at: Likewise. + * tests/truncate.at: Likewise. + +2018-12-27 Sergey Poznyakoff + + Fix CVE-2018-20482 + + * NEWS: Update. + * src/sparse.c (sparse_dump_region): Handle short read condition. + (sparse_extract_region,check_data_region): Fix dumped_size + calculation. + Handle short read condition. + (pax_decode_header): Fix dumped_size calculation. + * tests/Makefile.am: Add new testcases. + * tests/testsuite.at: Likewise. + + * tests/sptrcreat.at: New file. + * tests/sptrdiff00.at: New file. + * tests/sptrdiff01.at: New file. + +2018-12-21 Sergey Poznyakoff + + Disallow modifications to the global pax extended header in + update mode. + + Updating global headers in update mode is not possible, because: + + 1) If the original archive was not in PAX format, writing the + global header would overwrite first member header (and eventually + data blocks) in the archive. + 2) Otherwise, using the --pax-option can make the updated header + occupy more blocks than the original one, which would lead to the + same effect as in 1. + + This also fixes + http://lists.gnu.org/archive/html/bug-tar/2018-12/msg00007.html + + * src/xheader.c (xheader_forbid_global): New function. + * src/common.h (xheader_forbid_global): New prototype. + * src/update.c (update_archive): Use xheader_forbid_global, + instead + of trying to write global extended header record. + +2018-12-21 Sergey Poznyakoff + + Bugfix + + Bug reported in + http://lists.gnu.org/archive/html/bug-tar/2018-12/msg00014.html + + * src/names.c (collect_and_sort_names): Fix iteration over + namelist. + +2018-12-21 Sergey Poznyakoff + + Fix semantics of -K used together with explicit member names. + + This also fixes the bug reported in + http://lists.gnu.org/archive/html/bug-tar/2018-12/msg00012.html + + * src/common.h (starting_file_option): Describe the variable. + * src/names.c (add_starting_file): New function. + (name_match): Ignore everything before the member indicated by the + --starting-file option + * src/tar.c: Use add_starting_file to handle the -K option. + +2018-12-21 Sergey Poznyakoff + + Fix error handling when reading incremental snapshots + + Bug reported in + http://lists.gnu.org/archive/html/bug-tar/2018-12/msg00008.html + + * incremen.c (read_incr_db_01): Don't try to continue after + errors. + +2018-12-21 Sergey Poznyakoff + + Reject pax options starting with equals sign + + Bug reported in + http://lists.gnu.org/archive/html/bug-tar/2018-12/msg00010.html + + * xheader.c (xheader_set_keyword_equal): Bail out if the keyword + starts + with = + +2018-12-21 Sergey Poznyakoff + + Fix buffer overflow + + Bug reported in + http://lists.gnu.org/archive/html/bug-tar/2018-12/msg00011.html + + * src/xheader.c (xheader_format_name): fix length calculation + +2018-12-21 Sergey Poznyakoff + + Fix improper memory access + + Bug reported in + http://lists.gnu.org/archive/html/bug-tar/2018-12/msg00009.html + + * src/transform.c (parse_transform_expr): Check if re is not empty + before accessing its last byte. + +2018-11-24 Sergey Poznyakoff + + Fix parsing of ACLs + + Text returned by acl_to_text can contain comments (introduced + by #). + Strip comments and horizontal tabs prior to storing ACLs in PAX + headers. + + * src/xattrs.c (xattrs_acls_cleanup): New function. + (xattrs__acls_get_a,xattrs__acls_get_d): Use xattrs_acls_cleanup. + +2018-11-24 Sergey Poznyakoff + + Don't try to read past the end of header string fields + + * src/common.h (assign_string_n): New proto. + (ASSIGN_STRING_N): New macro. + * src/misc.c (assign_string_n): New function. + * gnulib.modules: Add strnlen. + * src/buffer.c: Use assign_string_n where appropriate. + * src/list.c: Likewise. + +2018-11-12 Sergey Poznyakoff + + Fix verbose ACL listing + + * src/xattrs.c (acls_one_line): Advance pos. + (xattrs_print): Insert a comma between ACL and default ACL if both + are non-empty. + +2018-10-29 Paul Eggert + + tar: fix numbered backup bug + + * src/misc.c (maybe_backup_file): Pass chdir_fd, not AT_FDCWD, + to find_backup_file_name. This fixes a bug whereby the wrong + backup file name was chosen for numbered backups. + +2018-10-29 Paul Eggert + + * src/tar.c (expand_pax_option): Pacify recent GCC. + +2018-10-29 Paul Eggert + + build: update gnulib submodule to latest + + * src/misc.c (maybe_backup_file): Adjust to Gnulib change. + +2018-08-02 Sergey Poznyakoff + + Minor fixes in wordsplit.c + +2018-08-02 Paul Eggert + + build: update gnulib submodule to latest + +2018-07-31 Sergey Poznyakoff + + Silence gcc warnings in wordsplit + +2018-07-31 Sergey Poznyakoff + + Fix double-free introduced by 577dc345 + + * src/utf8.c (utf8_convert): Don't store freed value in *output + +2018-07-31 Pavel Raiskup + + Report race on systems without O_DIRECTORY + + * src/names.c (collect_and_sort_names): Report ENOTDIR after + successful fstat() but !S_ISDIR. + +2018-07-31 Pavel Raiskup + + Avoid some resource leaks + + * src/incremen.c (store_rename): Free temp_name, leaked before for + each renamed directory with --listed-incremental. + * src/transform.c (add_literal_segment): Tighten arguments by + const. + (parse_transform_expr): Free 'str', leaked storage for each + --transform option before. + * src/utf8.c (utf8_convert): Deallocate buffer for failed iconv() + call so callers don't have to. + +2018-07-31 Sergey Poznyakoff + + Sync wordsplit and paxutils with the most recent versions + +2018-06-14 Paul Eggert + + * doc/tar.1: Fix font typo noted by esr. + +2018-05-16 Paul Eggert + + * doc/tar.1: Don't refer to nonexistent tar(5). + +2018-04-13 Jim Meyering + + --one-top-level: avoid a heap-buffer-overflow + + * NEWS: Mention this. + * src/suffix.c (strip_compression_suffix): Fix string comparison + guard. + Without this change, some ASAN-enabled test runs would fail + with the + following. Also, strip an additional .tar suffix only if + the just- + stripped suffix did not match /^\.t/". + + ==30815==ERROR: AddressSanitizer: heap-buffer-overflow on + address 0x6020000002ed at pc 0x00000049d1f4 bp 0x7ffeb5906d50 + sp 0x7ffeb5906500 + READ of size 1 at 0x6020000002ed thread T0 + SCARINESS: 12 (1-byte-read-heap-buffer-overflow) + #0 0x49d1f3 in __interceptor_strncmp + /j/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:407 + #1 0x5670f3 in strip_compression_suffix + /j/tar/src/suffix.c:107 + #2 0x575788 in decode_options /j/tar/src/tar.c:2545 + #3 0x5760c0 in main /j/tar/src/tar.c:2708 + #4 0x7f105090df29 in __libc_start_main ../csu/libc-start.c:308 + #5 0x408629 in _start (/j/tar/src/tar+0x408629) + + 0x6020000002ed is located 3 bytes to the left of 6-byte region + [0x6020000002f0,0x6020000002f6) + allocated by thread T0 here: + #0 0x4d0710 in __interceptor_malloc + /j/gcc/libsanitizer/asan/asan_malloc_linux.cc:86 + #1 0x4908ad in __interceptor_strndup + /j/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:326 + #2 0x5cbcbd in xstrndup /j/tar/gnu/xstrndup.c:32 + #3 0x5a325b in base_name /j/tar/gnu/basename.c:57 + #4 0x575772 in decode_options /j/tar/src/tar.c:2544 + #5 0x5760c0 in main /j/tar/src/tar.c:2708 + #6 0x7f105090df29 in __libc_start_main ../csu/libc-start.c:308 + +2018-04-07 Andrew Hounsell + + Tiny fix + + * doc/snapshot.texi: Fix a typo + * scripts/tar-snapshot-edit: Fix a typo + +2018-04-07 Jim Meyering + + tests: avoid test failure with non-ancient autoconf + + Running "make check" would fail with this: + T-nonl.at:30: error: m4_divert_push: cannot change diversion + to `GROW' inside m4_expand + * tests/T-nonl.at: Use printf in place of AS_ECHO_N. + These days, printf should work for everyone. + +2018-04-07 Jim Meyering + + maint: avoid -Wstringop-truncation warnings from upcoming GCC8 + + * src/create.c (start_private_header, start_header): Convert + trivial uses of strncpy to memcpy, to avoid warnings like this: + In function 'strncpy', + inlined from 'start_private_header' at create.c:522:3: + /usr/include/bits/string_fortified.h:106:10: warning: \ + '__builtin_strncpy' output truncated before terminating nul \ + copying 2 bytes from a string of the same length \ + [-Wstringop-truncation] + +2018-04-07 Jim Meyering + + maint: avoid -Wstringop-truncation warnings upcoming GCC8 + + * src/buffer.c (gnu_add_multi_volume_header): Convert a use of + strncpy to memcpy, to avoid this warning: + In function 'strncpy', + inlined from 'gnu_add_multi_volume_header' at buffer.c:1782:3, + ... + /usr/include/bits/string_fortified.h:106:10: error: + '__builtin_strncpy'\ + specified bound 100 equals destination size \ + [-Werror=stringop-truncation] + +2018-04-07 Jim Meyering + + maint: avoid warnings from upcoming GCC8 + + * src/transform.c (_single_transform_name_to_obstack): Mark with + FALLTHROUGH statement rather than /* FALL THROUGH */ comment. + Only the former works with gcc-8. + * src/extract.c (maybe_recoverable): Call abort to tell gcc-8 that + this code is unreachable. + +2018-04-07 Sergey Poznyakoff + + Rewrite struct tm formatting + + * src/list.c (tartime): Use strftime instead of manually + formatting + fields of the struct tm. This should also suppress some gcc + warnings. + +2018-04-07 Jim Meyering + + tests: add coverage for new --zstd and all other compression tools + + * tests/compress.at.in: New file: template from which each + per-compression-tool test is derived. + * tests/Makefile.am (TESTSUITE_AT): Add it. + (EXTRA_DIST): Add compress.at.in. + (compress-*.at): New rules to generate a file/tests for each + compression tool. + * tests/testsuite.at (Compression): Add each of these generated + files in a new section. + * tests/.gitignore: Ignore the new generated files. + +2018-03-18 Aaron Schrab + + Fix typo + +2018-03-18 Sergey Poznyakoff + + Version 1.30.90 + + * NEWS: Update. + * configure.ac: Update. + * THANKS: Add Adam Borowski. + +2018-03-18 Adam Borowski + + Add support for zstd compression + + * configure.ac (zstd): Register compression program. + * doc/tar.1: Mention --zstd. + * doc/tar.texi: Document zstd support. + * src/buffer.c: Register zstd compression. + * src/suffix.c: Add suffixes zst and tzst. + * src/tar.c: New compression option --zstd. + +2018-03-18 Pavel Raiskup + + tests: fix race in dirrem01 and dirrem02 + + Previously the '--checkpoint-action=echo' was triggered after + '--checkpoint-action=sleep=1' - so the order of events *usually* + was (for --format='gnu'): + + ... + 1. checkpoint handler before write of 'dir/sub' member + 2. one-second delay + 3. stderr write: 'tar: Write checkpoint 3' + 4. write the member 'dir/sub' into the archive + 5. check that the member's ctime has not been changed + 6. genfile's detecting 'Write checkpoint', doing unlink + ... + + But sometimes, the genfile was fast enough to win the race and + unlinked the directory before the member was written into the + archive (IOW, the order was 1-2-3-6-4-5). This led to the + occasional warning 'tar: dir/sub: file changed as we read it'. + + Swap the order of 'sleep=1' and 'echo' actions so the genfile + utility has (hopefully) enough time to do the unlink before + writing the file into the archive (enforce 1-2-3-6-4-5 order). + + * tests/dirrem01.at: Swap 'sleep=1' and 'echo' actions. + * tests/dirrem02.at: Likewise. + +2018-03-13 Sergey Poznyakoff + + Fix typos in the docs + +2018-03-13 Sergey Poznyakoff + + Provide a way to skip tests that create very large files + + Define environment variable TARTEST_SKIP_LARGE_FILES=1 in order + to skip tests that require lots of disk space. + + * tests/testsuite.at (AT_SKIP_LARGE_FILES): New macro. + * tests/sparse03.at: Mark test with AT_SKIP_LARGE_FILES. + * tests/sparse05.at: Likewise. + * tests/star/pax-big-10g.at: Likewise. + * tests/star/ustar-big-2g.at: Likewise. + * tests/star/ustar-big-8g.at: Likewise. + +2018-03-13 Sergey Poznyakoff + + Testsuite bugfix + + * tests/difflink.at: Define order of files within tested archive. + +2018-03-13 Sergey Poznyakoff + + testsuite: account for absolute file names starting with double + slash + + * tests/incr08.at: Absolute file names can start with // + * tests/xform03.at: Likewise. + 2017-12-17 Sergey Poznyakoff Version 1.30 diff --git a/Makefile.am b/Makefile.am index b48159718252435e4ff6110013aac371e0e0da25..15946e7a614b9dbca064db07ecfb1b555fd4b10d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,6 @@ # Main Makefile for GNU tar. -# Copyright 1994-1997, 1999-2001, 2003, 2007, 2009, 2013-2014, 2016-2017 -# Free Software Foundation, Inc. +# Copyright 1994-2019 Free Software Foundation, Inc. # This file is part of GNU tar. diff --git a/Makefile.in b/Makefile.in index f3b817b5c1cd35bee37ed448e93b39dc4df35150..502e4c44fa3344c9346e1dc34a0ff123080ac046 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -16,8 +16,7 @@ # Main Makefile for GNU tar. -# Copyright 1994-1997, 1999-2001, 2003, 2007, 2009, 2013-2014, 2016-2017 -# Free Software Foundation, Inc. +# Copyright 1994-2019 Free Software Foundation, Inc. # This file is part of GNU tar. @@ -60,7 +59,17 @@ # changelog_dir [mandatory] Directory where to create ChangeLog # changelog_amend_file [optional] Amendment file VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -122,26 +131,12 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(srcdir)/Make.rules INSTALL NEWS README AUTHORS \ - ChangeLog THANKS $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in ABOUT-NLS COPYING TODO build-aux/ar-lib \ - build-aux/compile build-aux/config.guess \ - build-aux/config.rpath build-aux/config.sub build-aux/depcomp \ - build-aux/install-sh build-aux/mdate-sh build-aux/missing \ - build-aux/texinfo.tex build-aux/ylwrap \ - $(top_srcdir)/build-aux/compile \ - $(top_srcdir)/build-aux/config.guess \ - $(top_srcdir)/build-aux/config.rpath \ - $(top_srcdir)/build-aux/config.sub \ - $(top_srcdir)/build-aux/install-sh \ - $(top_srcdir)/build-aux/missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/__inline.m4 \ $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/acl.m4 \ $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/argp.m4 \ - $(top_srcdir)/m4/asm-underscore.m4 \ $(top_srcdir)/m4/backupfile.m4 $(top_srcdir)/m4/bison.m4 \ $(top_srcdir)/m4/btowc.m4 $(top_srcdir)/m4/builtin-expect.m4 \ $(top_srcdir)/m4/canonicalize.m4 \ @@ -161,11 +156,12 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/extern-inline.m4 \ $(top_srcdir)/m4/faccessat.m4 $(top_srcdir)/m4/fchdir.m4 \ $(top_srcdir)/m4/fchmodat.m4 $(top_srcdir)/m4/fchownat.m4 \ - $(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/fcntl.m4 \ - $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fdopendir.m4 \ - $(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/filenamecat.m4 \ - $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \ - $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpending.m4 \ + $(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/fcntl-safer.m4 \ + $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fdopendir.m4 $(top_srcdir)/m4/fileblocks.m4 \ + $(top_srcdir)/m4/filenamecat.m4 $(top_srcdir)/m4/flexmember.m4 \ + $(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fnmatch.m4 \ + $(top_srcdir)/m4/fnmatch_h.m4 $(top_srcdir)/m4/fpending.m4 \ $(top_srcdir)/m4/fseek.m4 $(top_srcdir)/m4/fseeko.m4 \ $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/fstatat.m4 \ $(top_srcdir)/m4/futimens.m4 \ @@ -179,7 +175,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ $(top_srcdir)/m4/group-member.m4 \ - $(top_srcdir)/m4/hard-locale.m4 \ $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/human.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/include_next.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \ @@ -274,6 +269,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -337,6 +334,18 @@ ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Make.rules $(srcdir)/Makefile.in \ + $(srcdir)/config.h.in $(top_srcdir)/build-aux/compile \ + $(top_srcdir)/build-aux/config.guess \ + $(top_srcdir)/build-aux/config.rpath \ + $(top_srcdir)/build-aux/config.sub \ + $(top_srcdir)/build-aux/install-sh \ + $(top_srcdir)/build-aux/missing ABOUT-NLS AUTHORS COPYING \ + ChangeLog INSTALL NEWS README THANKS TODO build-aux/compile \ + build-aux/config.guess build-aux/config.rpath \ + build-aux/config.sub build-aux/depcomp build-aux/install-sh \ + build-aux/mdate-sh build-aux/missing build-aux/texinfo.tex \ + build-aux/ylwrap DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -469,6 +478,7 @@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ GNULIB_FGETC = @GNULIB_FGETC@ GNULIB_FGETS = @GNULIB_FGETS@ +GNULIB_FNMATCH = @GNULIB_FNMATCH@ GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ @@ -501,6 +511,7 @@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPASS = @GNULIB_GETPASS@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ @@ -517,6 +528,7 @@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ +GNULIB_LOCALENAME = @GNULIB_LOCALENAME@ GNULIB_LOCALTIME = @GNULIB_LOCALTIME@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_LSTAT = @GNULIB_LSTAT@ @@ -755,6 +767,7 @@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ @@ -778,6 +791,9 @@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFS = @HAVE_FFS@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ +HAVE_FNMATCH = @HAVE_FNMATCH@ +HAVE_FNMATCH_H = @HAVE_FNMATCH_H@ +HAVE_FREELOCALE = @HAVE_FREELOCALE@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSTATAT = @HAVE_FSTATAT@ HAVE_FSYNC = @HAVE_FSYNC@ @@ -790,13 +806,16 @@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETPASS = @HAVE_GETPASS@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@ HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ @@ -829,6 +848,7 @@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_NEWLOCALE = @HAVE_NEWLOCALE@ HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OPENDIR = @HAVE_OPENDIR@ @@ -899,7 +919,6 @@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ -HAVE_TRUNCATE = @HAVE_TRUNCATE@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_TZSET = @HAVE_TZSET@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ @@ -954,8 +973,6 @@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ -HOST_CPU = @HOST_CPU@ -HOST_CPU_C_ABI = @HOST_CPU_C_ABI@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL = @INSTALL@ @@ -1000,6 +1017,7 @@ NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ +NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H = @NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ @@ -1027,6 +1045,7 @@ NEXT_DIRENT_H = @NEXT_DIRENT_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_FNMATCH_H = @NEXT_FNMATCH_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ @@ -1087,9 +1106,11 @@ REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FNMATCH = @REPLACE_FNMATCH@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREELOCALE = @REPLACE_FREELOCALE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ @@ -1107,6 +1128,7 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETPASS = @REPLACE_GETPASS@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_GMTIME = @REPLACE_GMTIME@ REPLACE_ISATTY = @REPLACE_ISATTY@ @@ -1137,6 +1159,7 @@ REPLACE_MKNOD = @REPLACE_MKNOD@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ @@ -1342,7 +1365,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/Make.rules $(am__configu echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnits Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -1352,7 +1374,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; -$(srcdir)/Make.rules: +$(srcdir)/Make.rules $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck @@ -1572,15 +1594,15 @@ dist-xz: distdir $(am__post_remove_distdir) dist-tarZ: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -1616,16 +1638,17 @@ distcheck: dist esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -1801,6 +1824,8 @@ uninstall-am: mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-am uninstall uninstall-am +.PRECIOUS: Makefile + dist-hook: $(MAKE) changelog_dir=$(distdir) ChangeLog diff --git a/NEWS b/NEWS index cd15fa1b1fa5b9482e204d5a5c066da0319d7ced..acbebdd47098787ff847099e493c122f10b190ee 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,52 @@ -GNU tar NEWS - User visible changes. 2017-12-17 +GNU tar NEWS - User visible changes. 2019-02-23 Please send GNU tar bug reports to + +version 1.32 - Sergey Poznyakoff, 2019-02-23 + +* Fix the use of --checkpoint without explicit --checkpoint-action + +* Fix extraction with the -U option + +See http://lists.gnu.org/archive/html/bug-tar/2019-01/msg00015.html, +for details + +* Fix iconv usage on BSD-based systems + +* Fix possible NULL dereference (savannah bug #55369) + +* Improve the testsuite + + +version 1.31 - Sergey Poznyakoff, 2019-01-02 + +* Fix heap-buffer-overrun with --one-top-level. +Bug introduced with the addition of that option in 1.28. + +* Support for zstd compression + +New option '--zstd' instructs tar to use zstd as compression program. +When listing, extractng and comparing, zstd compressed archives are +recognized automatically. +When '-a' option is in effect, zstd compression is selected if the +destination archive name ends in '.zst' or '.tzst'. + +* The -K option interacts properly with member names given in the command line + +Names of members to extract can be specified along with the "-K NAME" +option. In this case, tar will extract NAME and those of named members +that appear in the archive after it, which is consistent with the +semantics of the option. + +Previous versions of tar extracted NAME, those of named members that +appeared before it, and everything after it. + +* Fix CVE-2018-20482 + +When creating archives with the --sparse option, previous versions of +tar would loop endlessly if a sparse file had been truncated while +being archived. + version 1.30 - Sergey Poznyakoff, 2017-12-17 @@ -42,7 +88,7 @@ causing subsequent link extractions in that directory to fail. This new warning control option suppresses warning messages about unreadable files and directories. It has effect only if used together -with the --ignore-failed-read option. +with the --ignore-failed-read option. * The --warnings=none option now suppresses all warnings @@ -1641,7 +1687,7 @@ Versions 1.07 back to 1.00 by Jay Fenlason. -Copyright 1994-2001, 2003-2010, 2013-2017 Free Software Foundation, Inc. +Copyright 1994-2019 Free Software Foundation, Inc. This file is part of GNU tar. diff --git a/README b/README index 874b5455e75e9c2d5a8980060cbe08044e151be4..3a14c7ef4f313cd872363e0a33f2b4f1671c82f8 100644 --- a/README +++ b/README @@ -221,8 +221,7 @@ and share your findings by writing to . * Copying -Copyright 1990-1992, 1994, 1997-2001, 2003-2004, 2007, 2012-2014, -2016-2017 Free Software Foundation, Inc. +Copyright 1990-2019 Free Software Foundation, Inc. This file is part of GNU tar. diff --git a/THANKS b/THANKS index 5e8e8c9233741b1f681ab32912ef7ed4a52ecb46..aee0a9241fd9bb35deb20e74940903e603ec6452 100644 --- a/THANKS +++ b/THANKS @@ -8,6 +8,7 @@ list of these people. Help me keep it complete and exempt of errors. See various ChangeLogs for a detailed description of contributions. Aage Robeck aagero@ifi.uio.no +Adam Borowski kilobyte@angband.pl Adye, TJ (Tim) T.J.Adye@rl.ac.uk Akiko Matsushita matusita@sra.co.jp Alan Bawden Alan@lcs.mit.edu @@ -94,6 +95,7 @@ Christian Laubscher christian.laubscher@tiscalinet.ch Christian T. Dum ctd@mpe-garching.mpg.de Christian von Roques roques@pond.sub.org Christian Wetzel wetzel@phoenix-pacs.de +Christian Weisgerber naddy@mips.inka.de Christoph Litauer litauer@mailhost.uni-koblenz.de Christophe Colle colle@krtkg1.rug.ac.be Christophe Kalt Christophe.Kalt@kbcfp.com diff --git a/TODO b/TODO index 752668aaa8e524cd84a36ac925c5b67bbd416a71..ecfc4f20435e249ef8add31e8cd90c2504aaf525 100644 --- a/TODO +++ b/TODO @@ -45,8 +45,7 @@ Suggestions for improving GNU tar. * Copyright notice -Copyright 2003-2004, 2007, 2013-2014, 2016-2017 Free Software -Foundation, Inc. +Copyright 2003-2019 Free Software Foundation, Inc. This file is part of GNU tar. diff --git a/acinclude.m4 b/acinclude.m4 index 635b3c543ba31141c904ae696a79d4786139bb22..960506cdbd43557da7b66770c61dcd7afdaeced7 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,6 +1,6 @@ dnl Special Autoconf macros for GNU tar -*- autoconf -*- -dnl Copyright 2009, 2013-2014, 2016-2017 Free Software Foundation, Inc. +dnl Copyright 2009-2019 Free Software Foundation, Inc. dnl dnl This file is part of GNU tar. dnl diff --git a/aclocal.m4 b/aclocal.m4 index 7d39b9b0f0dedd5b1c27e16d656c994077ffa216..38119414e7533420dd0a6655c404bb02a7ec3f28 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.14 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.14' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.14], [], +m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.14])dnl +[AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -103,15 +103,14 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -142,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -333,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -409,7 +408,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -499,8 +498,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -573,7 +572,11 @@ to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi -fi]) +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further @@ -602,7 +605,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -613,7 +616,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -623,7 +626,7 @@ if test x"${install_sh}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -644,7 +647,7 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -694,7 +697,7 @@ rm -f confinc confmf # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -733,7 +736,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -762,7 +765,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -809,7 +812,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -828,7 +831,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -909,7 +912,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -969,7 +972,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -997,7 +1000,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1016,7 +1019,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1148,11 +1151,11 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/00gnulib.m4]) +m4_include([m4/__inline.m4]) m4_include([m4/absolute-header.m4]) m4_include([m4/acl.m4]) m4_include([m4/alloca.m4]) m4_include([m4/argp.m4]) -m4_include([m4/asm-underscore.m4]) m4_include([m4/backupfile.m4]) m4_include([m4/bison.m4]) m4_include([m4/btowc.m4]) @@ -1188,6 +1191,7 @@ m4_include([m4/fchdir.m4]) m4_include([m4/fchmodat.m4]) m4_include([m4/fchownat.m4]) m4_include([m4/fcntl-o.m4]) +m4_include([m4/fcntl-safer.m4]) m4_include([m4/fcntl.m4]) m4_include([m4/fcntl_h.m4]) m4_include([m4/fdopendir.m4]) @@ -1196,6 +1200,7 @@ m4_include([m4/filenamecat.m4]) m4_include([m4/flexmember.m4]) m4_include([m4/float_h.m4]) m4_include([m4/fnmatch.m4]) +m4_include([m4/fnmatch_h.m4]) m4_include([m4/fpending.m4]) m4_include([m4/fseek.m4]) m4_include([m4/fseeko.m4]) @@ -1219,7 +1224,6 @@ m4_include([m4/glibc21.m4]) m4_include([m4/gnulib-common.m4]) m4_include([m4/gnulib-comp.m4]) m4_include([m4/group-member.m4]) -m4_include([m4/hard-locale.m4]) m4_include([m4/host-cpu-c-abi.m4]) m4_include([m4/human.m4]) m4_include([m4/iconv.m4]) diff --git a/build-aux/ar-lib b/build-aux/ar-lib deleted file mode 100755 index fe2301e71a86f025f97a189dc6b5374e8b0caa65..0000000000000000000000000000000000000000 --- a/build-aux/ar-lib +++ /dev/null @@ -1,270 +0,0 @@ -#! /bin/sh -# Wrapper for Microsoft lib.exe - -me=ar-lib -scriptversion=2012-03-01.08; # UTC - -# Copyright (C) 2010-2013 Free Software Foundation, Inc. -# Written by Peter Rosin . -# -# 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# 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 . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - - -# func_error message -func_error () -{ - echo "$me: $1" 1>&2 - exit 1 -} - -file_conv= - -# func_file_conv build_file -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. -func_file_conv () -{ - file=$1 - case $file in - / | /[!/]*) # absolute file, and not a UNC file - if test -z "$file_conv"; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv in - mingw) - file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` - ;; - cygwin) - file=`cygpath -m "$file" || echo "$file"` - ;; - wine) - file=`winepath -w "$file" || echo "$file"` - ;; - esac - ;; - esac -} - -# func_at_file at_file operation archive -# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE -# for each of them. -# When interpreting the content of the @FILE, do NOT use func_file_conv, -# since the user would need to supply preconverted file names to -# binutils ar, at least for MinGW. -func_at_file () -{ - operation=$2 - archive=$3 - at_file_contents=`cat "$1"` - eval set x "$at_file_contents" - shift - - for member - do - $AR -NOLOGO $operation:"$member" "$archive" || exit $? - done -} - -case $1 in - '') - func_error "no command. Try '$0 --help' for more information." - ;; - -h | --h*) - cat <. # # This program is free software; you can redistribute it and/or modify diff --git a/build-aux/config.guess b/build-aux/config.guess index 31e01efec3e3bb01d289f24d77baddb4f47a1f93..0f9b29c8848e3d7f43276c2c847486ecb4519be8 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2017 Free Software Foundation, Inc. +# Copyright 1992-2019 Free Software Foundation, Inc. -timestamp='2017-11-07' +timestamp='2019-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2017 Free Software Foundation, Inc. +Copyright 1992-2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,8 +84,6 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' 1 2 15 - # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a @@ -96,34 +94,38 @@ trap 'exit 1' 1 2 15 # Portable tmp directory creation inspired by the Autoconf team. -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$driver" + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then +if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi @@ -132,14 +134,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu - eval $set_cc_for_build - cat <<-EOF > $dummy.c + set_cc_for_build + cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc @@ -149,13 +151,20 @@ Linux|GNU|GNU/*) LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -169,30 +178,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - /sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` - machine=${arch}${endian}-unknown + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -208,10 +217,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Determine ABI tags. - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release @@ -219,52 +228,55 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}${abi}" + echo "$machine-${os}${release}${abi-}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) - echo ${UNAME_MACHINE}-unknown-midnightbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) - echo ${UNAME_MACHINE}-unknown-sortix + echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) - echo ${UNAME_MACHINE}-unknown-redox + echo "$UNAME_MACHINE"-unknown-redox exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -316,7 +328,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 @@ -325,10 +337,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos + echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -340,7 +352,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos @@ -367,19 +379,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} + echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build + set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. @@ -392,13 +404,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in @@ -407,25 +419,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} + echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not @@ -436,44 +448,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} + echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} + echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} + echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} + echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} + echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} + echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} + echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -494,11 +506,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} + echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -524,17 +536,17 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] then - echo m88k-dg-dgux${UNAME_RELEASE} + echo m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux${UNAME_RELEASE} + echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -551,7 +563,7 @@ EOF echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id @@ -563,14 +575,14 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -581,7 +593,7 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else @@ -595,7 +607,7 @@ EOF exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -604,9 +616,9 @@ EOF IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix @@ -615,7 +627,7 @@ EOF echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -630,28 +642,28 @@ EOF echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in + case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in + case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if [ "$HP_ARCH" = "" ]; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -684,13 +696,13 @@ EOF exit (0); } EOF - (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = hppa2.0w ] + if [ "$HP_ARCH" = hppa2.0w ] then - eval $set_cc_for_build + set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -709,15 +721,15 @@ EOF HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -742,7 +754,7 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; @@ -763,9 +775,9 @@ EOF exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + echo "$UNAME_MACHINE"-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -790,109 +802,120 @@ EOF echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + exit ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi + else + echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf + fi exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 + echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 + echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys + echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 + echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case "$UNAME_MACHINE" in x86) - echo i586-pc-interix${UNAME_RELEASE} + echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin + echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin + echo x86_64-pc-cygwin exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix + *:Minix:*:*) + echo "$UNAME_MACHINE"-unknown-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -906,63 +929,63 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - eval $set_cc_for_build + set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el @@ -976,70 +999,70 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} + echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} + echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} + echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} + echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} + echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} + echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} + echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1053,34 +1076,34 @@ EOF # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx + echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable + echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} + echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp + echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) @@ -1090,12 +1113,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1105,9 +1128,9 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv32 + echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) @@ -1127,9 +1150,9 @@ EOF exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1149,9 +1172,9 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1160,28 +1183,28 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} + echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} + echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} + echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} + echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} + echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 @@ -1192,7 +1215,7 @@ EOF *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi @@ -1212,23 +1235,23 @@ EOF exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos + echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} + echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1247,39 +1270,39 @@ EOF echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} + echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} + echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} + echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} + echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} + echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} + echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux${UNAME_RELEASE} + echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} + echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build + set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ @@ -1307,7 +1330,7 @@ EOF # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` @@ -1315,22 +1338,25 @@ EOF UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-*:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} + echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} + echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} + echo nsr-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk${UNAME_RELEASE} + echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1339,18 +1365,19 @@ EOF echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. + # shellcheck disable=SC2154 if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi - echo ${UNAME_MACHINE}-unknown-plan9 + echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 @@ -1371,14 +1398,14 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in + case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1387,25 +1414,28 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos + echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros + echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx + echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; + *:Unleashed:*:*) + echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" + exit ;; esac echo "$0: unable to guess system type" >&2 -case "${UNAME_MACHINE}:${UNAME_SYSTEM}" in +case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 </dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: -# eval: (add-hook 'write-file-functions 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/build-aux/config.rpath b/build-aux/config.rpath index af3c41559897f01d2404b58b4fde1241e8ecf7d0..be202c1a9e79567b62ac71c96ee9f2bec8f40324 100755 --- a/build-aux/config.rpath +++ b/build-aux/config.rpath @@ -2,7 +2,7 @@ # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # -# Copyright 1996-2017 Free Software Foundation, Inc. +# Copyright 1996-2019 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # diff --git a/build-aux/config.sub b/build-aux/config.sub index fb5794786954f321c766ea3d3c33b7ca6b5eb343..a8f3f7e7cde8d60f4956d7e7fc0e56dc6609cf9a 100755 --- a/build-aux/config.sub +++ b/build-aux/config.sub @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2017 Free Software Foundation, Inc. +# Copyright 1992-2019 Free Software Foundation, Inc. -timestamp='2017-11-04' +timestamp='2019-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -67,7 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2017 Free Software Foundation, Inc. +Copyright 1992-2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -89,12 +89,12 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - echo "$me: invalid option $1$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -110,1251 +110,1160 @@ case $# in exit 1;; esac -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | cloudabi*-eabi* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac +# Split fields of configuration type +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 ;; - -lynx*) - os=-lynxos + *-*-*-*) + basic_machine=$field1-$field2 + os=$field3-$field4 ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ + | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + os=linux-android + ;; + *) + basic_machine=$field1-$field2 + os=$field3 + ;; + esac ;; - -psos*) - os=-psos + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + os= + ;; + *) + basic_machine=$field1 + os=$field2 + ;; + esac + ;; + esac ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + os=bsd + ;; + a29khif) + basic_machine=a29k-amd + os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=scout + ;; + alliant) + basic_machine=fx80-alliant + os= + ;; + altos | altos3068) + basic_machine=m68k-altos + os= + ;; + am29k) + basic_machine=a29k-none + os=bsd + ;; + amdahl) + basic_machine=580-amdahl + os=sysv + ;; + amiga) + basic_machine=m68k-unknown + os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=bsd + ;; + aros) + basic_machine=i386-pc + os=aros + ;; + aux) + basic_machine=m68k-apple + os=aux + ;; + balance) + basic_machine=ns32k-sequent + os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=linux + ;; + cegcc) + basic_machine=arm-unknown + os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=bsd + ;; + convex-c2) + basic_machine=c2-convex + os=bsd + ;; + convex-c32) + basic_machine=c32-convex + os=bsd + ;; + convex-c34) + basic_machine=c34-convex + os=bsd + ;; + convex-c38) + basic_machine=c38-convex + os=bsd + ;; + cray) + basic_machine=j90-cray + os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + os= + ;; + da30) + basic_machine=m68k-da30 + os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + os= + ;; + delta88) + basic_machine=m88k-motorola + os=sysv3 + ;; + dicos) + basic_machine=i686-pc + os=dicos + ;; + djgpp) + basic_machine=i586-pc + os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=ose + ;; + gmicro) + basic_machine=tron-gmicro + os=sysv + ;; + go32) + basic_machine=i386-pc + os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=hms + ;; + harris) + basic_machine=m88k-harris + os=sysv3 + ;; + hp300) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=hpux + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=proelf + ;; + i386mach) + basic_machine=i386-mach + os=mach + ;; + vsta) + basic_machine=i386-pc + os=vsta + ;; + isi68 | isi) + basic_machine=m68k-isi + os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + os=sysv + ;; + merlin) + basic_machine=ns32k-utek + os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + os=coff + ;; + morphos) + basic_machine=powerpc-unknown + os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=moxiebox + ;; + msdos) + basic_machine=i386-pc + os=msdos + ;; + msys) + basic_machine=i686-pc + os=msys + ;; + mvs) + basic_machine=i370-ibm + os=mvs + ;; + nacl) + basic_machine=le32-unknown + os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=newsos + ;; + news1000) + basic_machine=m68030-sony + os=newsos + ;; + necv70) + basic_machine=v70-nec + os=sysv + ;; + nh3000) + basic_machine=m68k-harris + os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=cxux + ;; + nindy960) + basic_machine=i960-intel + os=nindy + ;; + mon960) + basic_machine=i960-intel + os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=ose + ;; + os68k) + basic_machine=m68k-none + os=os68k + ;; + paragon) + basic_machine=i860-intel + os=osf + ;; + parisc) + basic_machine=hppa-unknown + os=linux + ;; + pw32) + basic_machine=i586-unknown + os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=rdos + ;; + rdos32) + basic_machine=i386-pc + os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=coff + ;; + sa29200) + basic_machine=a29k-amd + os=udi + ;; + sei) + basic_machine=mips-sei + os=seiux + ;; + sequent) + basic_machine=i386-sequent + os= + ;; + sps7) + basic_machine=m68k-bull + os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + os= + ;; + stratus) + basic_machine=i860-stratus + os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + os= + ;; + sun2os3) + basic_machine=m68000-sun + os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + os= + ;; + sun3os3) + basic_machine=m68k-sun + os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + os= + ;; + sun4os3) + basic_machine=sparc-sun + os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + os= + ;; + sv1) + basic_machine=sv1-cray + os=unicos + ;; + symmetry) + basic_machine=i386-sequent + os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=unicos + ;; + t90) + basic_machine=t90-cray + os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + os=tpf + ;; + udi29k) + basic_machine=a29k-amd + os=udi + ;; + ultra3) + basic_machine=a29k-nyu + os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=none + ;; + vaxv) + basic_machine=vax-dec + os=sysv + ;; + vms) + basic_machine=vax-dec + os=vms + ;; + vxworks960) + basic_machine=i960-wrs + os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=vxworks + ;; + xbox) + basic_machine=i686-pc + os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + os=unicos + ;; + *) + basic_machine=$1 + os= + ;; + esac ;; esac -# Decode aliases for certain CPU-COMPANY combinations. +# Decode 1-component or ad-hoc basic machines case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | ba \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia16 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pru \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | wasm32 \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none + op50n) + cpu=hppa1.1 + vendor=oki ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + op60c) + cpu=hppa1.1 + vendor=oki ;; - ms1) - basic_machine=mt-unknown + ibm*) + cpu=i370 + vendor=ibm ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none + orion105) + cpu=clipper + vendor=highlevel ;; - xscaleeb) - basic_machine=armeb-unknown + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple ;; - - xscaleel) - basic_machine=armel-unknown + pmac | pmac-mpw) + cpu=powerpc + vendor=apple ;; - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | ba-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pru-* \ - | pyramid-* \ - | riscv32-* | riscv64-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | wasm32-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att + cpu=m68000 + vendor=att ;; 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - asmjs) - basic_machine=asmjs-unknown - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + cpu=we32k + vendor=att ;; bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec + cpu=powerpc + vendor=ibm + os=cnk ;; decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 + cpu=pdp10 + vendor=dec + os=tops10 ;; decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 + cpu=pdp10 + vendor=dec + os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx + cpu=m68k + vendor=motorola ;; dpx2*) - basic_machine=m68k-bull - os=-sysv3 - ;; - e500v[12]) - basic_machine=powerpc-unknown - os=$os"spe" - ;; - e500v[12]-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - os=$os"spe" - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd + cpu=m68k + vendor=bull + os=sysv3 ;; encore | umax | mmax) - basic_machine=ns32k-encore + cpu=ns32k + vendor=encore ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose + elxsi) + cpu=elxsi + vendor=elxsi + os=${os:-bsd} ;; fx2800) - basic_machine=i860-alliant + cpu=i860 + vendor=alliant ;; genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 + cpu=ns32k + vendor=ns ;; h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux + cpu=hppa1.1 + vendor=hitachi + os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp + cpu=m68000 + vendor=hp ;; hp9k3[2-9][0-9]) - basic_machine=m68k-hp + cpu=m68k + vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm + cpu=hppa1.0 + vendor=hp ;; i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv32 ;; i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv4 ;; i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv ;; i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=solaris2 ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta + j90 | j90-cray) + cpu=j90 + vendor=cray + os=${os:-unicos} ;; iris | iris4d) - basic_machine=mips-sgi + cpu=mips + vendor=sgi case $os in - -irix*) + irix*) ;; *) - os=-irix4 + os=irix4 ;; esac ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl + cpu=m68000 + vendor=convergent ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + os=mint ;; news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv + cpu=mips + vendor=sony + os=newsos ;; next | m*-next) - basic_machine=m68k-next + cpu=m68k + vendor=next case $os in - -nextstep* ) + nextstep* ) ;; - -ns2*) - os=-nextstep2 + ns2*) + os=nextstep2 ;; *) - os=-nextstep3 + os=nextstep3 ;; esac ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - nsx-tandem) - basic_machine=nsx-tandem + cpu=np1 + vendor=gould ;; op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k + cpu=hppa1.1 + vendor=oki + os=proelf ;; pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + cpu=hppa1.1 + vendor=hitachi + os=hiuxwe2 ;; pbd) - basic_machine=sparc-tti + cpu=sparc + vendor=tti ;; pbb) - basic_machine=m68k-tti + cpu=m68k + vendor=tti ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + pc532) + cpu=ns32k + vendor=pc532 ;; pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm + cpu=pn + vendor=gould ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + power) + cpu=power + vendor=ibm ;; ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff + cpu=i386 + vendor=ibm ;; rm[46]00) - basic_machine=mips-siemens + cpu=mips + vendor=siemens ;; rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown + cpu=romp + vendor=ibm ;; sde) - basic_machine=mipsisa32-sde - os=-elf + cpu=mipsisa32 + vendor=sde + os=${os:-elf} ;; - sei) - basic_machine=mips-sei - os=-seiux + simso-wrs) + cpu=sparclite + vendor=wrs + os=vxworks ;; - sequent) - basic_machine=i386-sequent + tower | tower-32) + cpu=m68k + vendor=ncr ;; - sh) - basic_machine=sh-hitachi - os=-hms + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu ;; - sh5el) - basic_machine=sh5le-unknown + w65) + cpu=w65 + vendor=wdc ;; - sh64) - basic_machine=sh64-unknown + w89k-*) + cpu=hppa1.1 + vendor=winbond + os=proelf ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks + none) + cpu=none + vendor=none ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine ;; - spur) - basic_machine=spur-unknown + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; - st2000) - basic_machine=m68k-tandem + + *-*) + IFS="-" read cpu vendor <&2 - exit 1 + # Recognize the canonical CPU types that are allowed with any + # company name. + case $cpu in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ + | alphapca5[67] | alpha64pca5[67] \ + | am33_2.0 \ + | amdgcn \ + | arc | arceb \ + | arm | arm[lb]e | arme[lb] | armv* \ + | avr | avr32 \ + | asmjs \ + | ba \ + | be32 | be64 \ + | bfin | bs2000 \ + | c[123]* | c30 | [cjt]90 | c4x \ + | c8051 | clipper | craynv | csky | cydra \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | elxsi | epiphany \ + | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ + | h8300 | h8500 \ + | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i*86 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle \ + | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k | v70 | w65 \ + | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip \ + | m88110 | m88k | maxq | mb | mcore | mep | metag \ + | microblaze | microblazeel \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mmix \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | none | np1 | ns16k | ns32k \ + | open8 \ + | or1k* \ + | or32 \ + | orion \ + | pdp10 | pdp11 | pj | pjl | pn | power \ + | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ + | pru \ + | pyramid \ + | riscv | riscv32 | riscv64 \ + | rl78 | romp | rs6000 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ + | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ + | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ + | spu \ + | tahoe \ + | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ + | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ + | vax \ + | visium \ + | wasm32 \ + | we32k \ + | x86 | x86_64 | xc16x | xgate | xps100 \ + | xstormy16 | xtensa* \ + | ymp \ + | z8k | z80) + ;; + + *) + echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 + exit 1 + ;; + esac ;; esac # Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` +case $vendor in + digital*) + vendor=dec ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + commodore*) + vendor=cbm ;; *) ;; @@ -1362,200 +1271,246 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x"$os" != x"" ] +if [ x$os != x ] then case $os in # First match some system type aliases that might get confused # with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + # solaris* is a basic system type, with this one exception. + auroraux) + os=auroraux ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` + bluegene*) + os=cnk ;; - -solaris) - os=-solaris2 + solaris1 | solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; - -svr4*) - os=-sysv4 + solaris) + os=solaris2 ;; - -unixware*) - os=-sysv4.2uw + unixware*) + os=sysv4.2uw ;; - -gnu/linux*) + gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; + # es1800 is here to avoid being matched by es* (a different OS) + es1800*) + os=ose + ;; + # Some version numbers need modification + chorusos*) + os=chorusos + ;; + isc) + os=isc2.2 + ;; + sco6) + os=sco5v6 + ;; + sco5) + os=sco3.2v5 + ;; + sco4) + os=sco3.2v4 + ;; + sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + ;; + sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + scout) + # Don't match below + ;; + sco*) + os=sco3.2v2 + ;; + psos*) + os=psos + ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* | -cloudabi* | -sortix* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ - | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) + # sysv* is not here because it comes later, after sysvr4. + gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | kopensolaris* | plan9* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | knetbsd* | mirbsd* | netbsd* \ + | bitrig* | openbsd* | solidbsd* | libertybsd* \ + | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ + | linux-newlib* | linux-musl* | linux-uclibc* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* \ + | morphos* | superux* | rtmk* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten*) # Remember, each alternative MUST END IN *, to match a version number. ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) + qnx*) + case $cpu in + x86 | i*86) ;; *) - os=-nto$os + os=nto-$os ;; esac ;; - -nto-qnx*) + hiux*) + os=hiuxwe2 ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` + nto-qnx*) ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` + sim | xray | os68k* | v88r* \ + | windows* | osx | abug | netware* | os9* \ + | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) ;; - -linux-dietlibc) - os=-linux-dietlibc + linux-dietlibc) + os=linux-dietlibc ;; - -linux*) + linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` + lynx*178) + os=lynxos178 + ;; + lynx*5) + os=lynxos5 ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` + lynx*) + os=lynxos ;; - -opened*) - os=-openedition + mac*) + os=`echo "$os" | sed -e 's|mac|macos|'` ;; - -os400*) - os=-os400 + opened*) + os=openedition ;; - -wince*) - os=-wince + os400*) + os=os400 ;; - -osfrose*) - os=-osfrose + sunos5*) + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; - -osf*) - os=-osf + sunos6*) + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; - -utek*) - os=-bsd + wince*) + os=wince ;; - -dynix*) - os=-bsd + utek*) + os=bsd ;; - -acis*) - os=-aos + dynix*) + os=bsd ;; - -atheos*) - os=-atheos + acis*) + os=aos ;; - -syllable*) - os=-syllable + atheos*) + os=atheos ;; - -386bsd) - os=-bsd + syllable*) + os=syllable ;; - -ctix* | -uts*) - os=-sysv + 386bsd) + os=bsd + ;; + ctix* | uts*) + os=sysv ;; - -nova*) - os=-rtmk-nova + nova*) + os=rtmk-nova ;; - -ns2) - os=-nextstep2 + ns2) + os=nextstep2 ;; - -nsk*) - os=-nsk + nsk*) + os=nsk ;; # Preserve the version number of sinix5. - -sinix5.*) + sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf + sinix*) + os=sysv4 ;; - -triton*) - os=-sysv3 + tpf*) + os=tpf ;; - -oss*) - os=-sysv3 + triton*) + os=sysv3 ;; - -svr4) - os=-sysv4 + oss*) + os=sysv3 ;; - -svr3) - os=-sysv3 + svr4*) + os=sysv4 ;; - -sysvr4) - os=-sysv4 + svr3) + os=sysv3 ;; - # This must come after -sysvr4. - -sysv*) + sysvr4) + os=sysv4 ;; - -ose*) - os=-ose + # This must come after sysvr4. + sysv*) ;; - -es1800*) - os=-ose + ose*) + os=ose ;; - -xenix) - os=-xenix + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + os=mint ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint + zvmoe) + os=zvmoe ;; - -aros*) - os=-aros + dicos*) + os=dicos ;; - -zvmoe) - os=-zvmoe + pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $cpu in + arm*) + os=eabi + ;; + *) + os=elf + ;; + esac ;; - -dicos*) - os=-dicos + nacl*) ;; - -nacl*) + ios) ;; - -ios) + none) ;; - -none) + *-eabi) ;; *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac @@ -1571,264 +1526,265 @@ else # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. -case $basic_machine in +case $cpu-$vendor in score-*) - os=-elf + os=elf ;; spu-*) - os=-elf + os=elf ;; *-acorn) - os=-riscix1.2 + os=riscix1.2 ;; arm*-rebel) - os=-linux + os=linux ;; arm*-semi) - os=-aout + os=aout ;; c4x-* | tic4x-*) - os=-coff + os=coff ;; c8051-*) - os=-elf + os=elf + ;; + clipper-intergraph) + os=clix ;; hexagon-*) - os=-elf + os=elf ;; tic54x-*) - os=-coff + os=coff ;; tic55x-*) - os=-coff + os=coff ;; tic6x-*) - os=-coff + os=coff ;; # This must come before the *-dec entry. pdp10-*) - os=-tops20 + os=tops20 ;; pdp11-*) - os=-none + os=none ;; *-dec | vax-*) - os=-ultrix4.2 + os=ultrix4.2 ;; m68*-apollo) - os=-domain + os=domain ;; i386-sun) - os=-sunos4.0.2 + os=sunos4.0.2 ;; m68000-sun) - os=-sunos3 + os=sunos3 ;; m68*-cisco) - os=-aout + os=aout ;; mep-*) - os=-elf + os=elf ;; mips*-cisco) - os=-elf + os=elf ;; mips*-*) - os=-elf + os=elf ;; or32-*) - os=-coff + os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 + os=sysv3 ;; sparc-* | *-sun) - os=-sunos4.1.1 + os=sunos4.1.1 ;; pru-*) - os=-elf + os=elf ;; *-be) - os=-beos - ;; - *-haiku) - os=-haiku + os=beos ;; *-ibm) - os=-aix + os=aix ;; *-knuth) - os=-mmixware + os=mmixware ;; *-wec) - os=-proelf + os=proelf ;; *-winbond) - os=-proelf + os=proelf ;; *-oki) - os=-proelf + os=proelf ;; *-hp) - os=-hpux + os=hpux ;; *-hitachi) - os=-hiux + os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv + os=sysv ;; *-cbm) - os=-amigaos + os=amigaos ;; *-dg) - os=-dgux + os=dgux ;; *-dolphin) - os=-sysv3 + os=sysv3 ;; m68k-ccur) - os=-rtu + os=rtu ;; m88k-omron*) - os=-luna + os=luna ;; *-next) - os=-nextstep + os=nextstep ;; *-sequent) - os=-ptx + os=ptx ;; *-crds) - os=-unos + os=unos ;; *-ns) - os=-genix + os=genix ;; i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 + os=mvs ;; *-gould) - os=-sysv + os=sysv ;; *-highlevel) - os=-bsd + os=bsd ;; *-encore) - os=-bsd + os=bsd ;; *-sgi) - os=-irix + os=irix ;; *-siemens) - os=-sysv4 + os=sysv4 ;; *-masscomp) - os=-rtu + os=rtu ;; f30[01]-fujitsu | f700-fujitsu) - os=-uxpv + os=uxpv ;; *-rom68k) - os=-coff + os=coff ;; *-*bug) - os=-coff + os=coff ;; *-apple) - os=-macos + os=macos ;; *-atari*) - os=-mint + os=mint + ;; + *-wrs) + os=vxworks ;; *) - os=-none + os=none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) +case $vendor in + unknown) case $os in - -riscix*) + riscix*) vendor=acorn ;; - -sunos*) + sunos*) vendor=sun ;; - -cnk*|-aix*) + cnk*|-aix*) vendor=ibm ;; - -beos*) + beos*) vendor=be ;; - -hpux*) + hpux*) vendor=hp ;; - -mpeix*) + mpeix*) vendor=hp ;; - -hiux*) + hiux*) vendor=hitachi ;; - -unos*) + unos*) vendor=crds ;; - -dgux*) + dgux*) vendor=dg ;; - -luna*) + luna*) vendor=omron ;; - -genix*) + genix*) vendor=ns ;; - -mvs* | -opened*) + clix*) + vendor=intergraph + ;; + mvs* | opened*) vendor=ibm ;; - -os400*) + os400*) vendor=ibm ;; - -ptx*) + ptx*) vendor=sequent ;; - -tpf*) + tpf*) vendor=ibm ;; - -vxsim* | -vxworks* | -windiss*) + vxsim* | vxworks* | windiss*) vendor=wrs ;; - -aux*) + aux*) vendor=apple ;; - -hms*) + hms*) vendor=hitachi ;; - -mpw* | -macos*) + mpw* | macos*) vendor=apple ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) vendor=atari ;; - -vos*) + vos*) vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$cpu-$vendor-$os" exit # Local variables: -# eval: (add-hook 'write-file-functions 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/build-aux/depcomp b/build-aux/depcomp index 5ff3c6feb4ba8c9cacfae53687d24683becc3d34..65cbf7093a1e4c4a2da08ac8dcd725f8376c344c 100755 --- a/build-aux/depcomp +++ b/build-aux/depcomp @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2017-09-16.17; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +# Copyright (C) 1999-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 @@ -783,7 +783,7 @@ exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog index 3c94bd56a0bc5aae4acf80ce1d5d4c52956da9e0..deddef24466eb6b0d8ff695c5d6504df8ed647c8 100755 --- a/build-aux/gitlog-to-changelog +++ b/build-aux/gitlog-to-changelog @@ -3,13 +3,13 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"' if 0; # Convert git log output to ChangeLog format. -my $VERSION = '2017-09-13 06:45'; # UTC +my $VERSION = '2018-03-07 03:47'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook # do its job. Otherwise, update this string manually. -# Copyright (C) 2008-2017 Free Software Foundation, Inc. +# Copyright (C) 2008-2019 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 @@ -491,7 +491,7 @@ sub git_dir_option($) # Local Variables: # mode: perl # indent-tabs-mode: nil -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "my $VERSION = '" # time-stamp-format: "%:y-%02m-%02d %02H:%02M" # time-stamp-time-zone: "UTC0" diff --git a/build-aux/install-sh b/build-aux/install-sh index ac159ceda40d78bbd6606879377a1c7ca7adad1c..8175c640fe6288a75cc846567ea5506086f326f4 100755 --- a/build-aux/install-sh +++ b/build-aux/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2017-09-23.17; # UTC +scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -332,34 +332,43 @@ do # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) + # Note that $RANDOM variable is not portable (e.g. dash); Use it + # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p' feature. if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi - rmdir "$tmpdir/d" "$tmpdir" + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; @@ -501,7 +510,7 @@ do done # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/build-aux/mdate-sh b/build-aux/mdate-sh index 34de97554a83ab98dcc12ae485e219bcb047a80b..8c7a5901a0690aded843445b891b91f3fe8002df 100755 --- a/build-aux/mdate-sh +++ b/build-aux/mdate-sh @@ -1,9 +1,9 @@ #!/bin/sh # Get modification time of a file or directory and pretty-print it. -scriptversion=2017-09-22.02; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1995-2017 Free Software Foundation, Inc. +# Copyright (C) 1995-2018 Free Software Foundation, Inc. # written by Ulrich Drepper , June 1995 # # This program is free software; you can redistribute it and/or modify @@ -220,7 +220,7 @@ echo $day $month $year # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/build-aux/missing b/build-aux/missing index cdea514931f558be2bcc47ef2d52e14ab395520b..f62bbae306c7e1bc28896aab8fe7bfb700a9a33e 100755 --- a/build-aux/missing +++ b/build-aux/missing @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-06-26.16; # UTC +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -160,7 +160,7 @@ give_advice () ;; autom4te*) echo "You might have modified some maintainer files that require" - echo "the 'automa4te' program to be rebuilt." + echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) diff --git a/build-aux/texinfo.tex b/build-aux/texinfo.tex index 022c3f5b3701213bb2dcdbb3ebce10fe83482534..66a832e0b4f2479b9d792a5a596eb3f5bf120fb7 100644 --- a/build-aux/texinfo.tex +++ b/build-aux/texinfo.tex @@ -3,12 +3,9 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2017-09-11.18} +\def\texinfoversion{2018-12-28.17} % -% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, -% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 -% Free Software Foundation, Inc. +% Copyright 1985, 1986, 1988, 1990-2018 Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as @@ -244,17 +241,7 @@ % \def\finalout{\overfullrule=0pt } -% Do @cropmarks to get crop marks. -% -\newif\ifcropmarks -\let\cropmarks = \cropmarkstrue -% -% Dimensions to add cropmarks at corners. -% Added by P. A. MacKay, 12 Nov. 1986 -% \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines -\newdimen\cornerlong \cornerlong=1pc -\newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in % Output a mark which sets \thischapter, \thissection and \thiscolor. @@ -328,12 +315,12 @@ \newbox\footlinebox % \onepageout takes a vbox as an argument. -% \shipout a vbox for a single page, adding an optional header, footer, -% cropmarks, and footnote. This also causes index entries for this page -% to be written to the auxiliary files. +% \shipout a vbox for a single page, adding an optional header, footer +% and footnote. This also causes index entries for this page to be written +% to the auxiliary files. % \def\onepageout#1{% - \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi + \hoffset=\normaloffset % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi @@ -386,25 +373,6 @@ % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi % - \ifcropmarks \vbox to \outervsize\bgroup - \hsize = \outerhsize - \vskip-\topandbottommargin - \vtop to0pt{% - \line{\ewtop\hfil\ewtop}% - \nointerlineskip - \line{% - \vbox{\moveleft\cornerthick\nstop}% - \hfill - \vbox{\moveright\cornerthick\nstop}% - }% - \vss}% - \vskip\topandbottommargin - \line\bgroup - \hfil % center the page within the outer (page) hsize. - \ifodd\pageno\hskip\bindingoffset\fi - \vbox\bgroup - \fi - % \unvbox\headlinebox \pagebody{#1}% \ifdim\ht\footlinebox > 0pt @@ -415,22 +383,6 @@ \unvbox\footlinebox \fi % - \ifcropmarks - \egroup % end of \vbox\bgroup - \hfil\egroup % end of (centering) \line\bgroup - \vskip\topandbottommargin plus1fill minus1fill - \boxmaxdepth = \cornerthick - \vbox to0pt{\vss - \line{% - \vbox{\moveleft\cornerthick\nsbot}% - \hfill - \vbox{\moveright\cornerthick\nsbot}% - }% - \nointerlineskip - \line{\ewbot\hfil\ewbot}% - }% - \egroup % \vbox from first cropmarks clause - \fi }% end of \shipout\vbox }% end of group with \indexdummies \advancepageno @@ -451,17 +403,6 @@ \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } -% Here are the rules for the cropmarks. Note that they are -% offset so that the space between them is truly \outerhsize or \outervsize -% (P. A. MacKay, 12 November, 1986) -% -\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} -\def\nstop{\vbox - {\hrule height\cornerthick depth\cornerlong width\cornerthick}} -\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} -\def\nsbot{\vbox - {\hrule height\cornerlong depth\cornerthick width\cornerthick}} - % Argument parsing @@ -1528,6 +1469,9 @@ output) for that.)} \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% \endgroup} + % \pdfgettoks - Surround page numbers in #1 with @pdflink. #1 may + % be a simple number, or a list of numbers in the case of an index + % entry. \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} @@ -2235,6 +2179,20 @@ end \font\smallersy=cmsy8 \def\smallerecsize{0800} +% Fonts for math mode superscripts (7pt). +\def\sevennominalsize{7pt} +\setfont\sevenrm\rmshape{7}{1000}{OT1} +\setfont\seventt\ttshape{10}{700}{OT1TT} +\setfont\sevenbf\bfshape{10}{700}{OT1} +\setfont\sevenit\itshape{7}{1000}{OT1IT} +\setfont\sevensl\slshape{10}{700}{OT1} +\setfont\sevensf\sfshape{10}{700}{OT1} +\setfont\sevensc\scshape{10}{700}{OT1} +\setfont\seventtsl\ttslshape{10}{700}{OT1TT} +\font\seveni=cmmi7 +\font\sevensy=cmsy7 +\def\sevenecsize{0700} + % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} @@ -2369,6 +2327,20 @@ end \font\smallersy=cmsy8 \def\smallerecsize{0800} +% Fonts for math mode superscripts (7pt). +\def\sevennominalsize{7pt} +\setfont\sevenrm\rmshape{7}{1000}{OT1} +\setfont\seventt\ttshape{10}{700}{OT1TT} +\setfont\sevenbf\bfshape{10}{700}{OT1} +\setfont\sevenit\itshape{7}{1000}{OT1IT} +\setfont\sevensl\slshape{10}{700}{OT1} +\setfont\sevensf\sfshape{10}{700}{OT1} +\setfont\sevensc\scshape{10}{700}{OT1} +\setfont\seventtsl\ttslshape{10}{700}{OT1TT} +\font\seveni=cmmi7 +\font\sevensy=cmsy7 +\def\sevenecsize{0700} + % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} @@ -2503,13 +2475,20 @@ end % In order for the font changes to affect most math symbols and letters, -% we have to define the \textfont of the standard families. We don't -% bother to reset \scriptfont and \scriptscriptfont; awaiting user need. +% we have to define the \textfont of the standard families. +% We don't bother to reset \scriptscriptfont; awaiting user need. % \def\resetmathfonts{% \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont \textfont\ttfam=\ttfont \textfont\sffam=\sffont + % + % Fonts for superscript. Note that the 7pt fonts are used regardless + % of the current font size. + \scriptfont0=\sevenrm \scriptfont1=\seveni \scriptfont2=\sevensy + \scriptfont\itfam=\sevenit \scriptfont\slfam=\sevensl + \scriptfont\bffam=\sevenbf \scriptfont\ttfam=\seventt + \scriptfont\sffam=\sevensf } % @@ -2519,6 +2498,9 @@ end % to also set the current \fam for math mode. Our \STYLE (e.g., \rm) % commands hardwire \STYLEfont to set the current font. % +% The fonts used for \ifont are for "math italics" (\itfont is for italics +% in regular text). \syfont is also used in math mode only. +% % Each font-changing command also sets the names \lsize (one size lower) % and \lllsize (three sizes lower). These relative commands are used % in, e.g., the LaTeX logo and acronyms. @@ -2619,26 +2601,11 @@ end % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will % define and register \INITMACRO to be called on markup style changes. % \INITMACRO can check \currentmarkupstyle for the innermost -% style and the set of \ifmarkupSTYLE switches for all styles -% currently in effect. -\newif\ifmarkupvar -\newif\ifmarkupsamp -\newif\ifmarkupkey -%\newif\ifmarkupfile % @file == @samp. -%\newif\ifmarkupoption % @option == @samp. -\newif\ifmarkupcode -\newif\ifmarkupkbd -%\newif\ifmarkupenv % @env == @code. -%\newif\ifmarkupcommand % @command == @code. -\newif\ifmarkuptex % @tex (and part of @math, for now). -\newif\ifmarkupexample -\newif\ifmarkupverb -\newif\ifmarkupverbatim +% style. \let\currentmarkupstyle\empty \def\setupmarkupstyle#1{% - \csname markup#1true\endcsname \def\currentmarkupstyle{#1}% \markupstylesetup } @@ -2700,11 +2667,15 @@ end % lilypond developers report. xpdf does work with the regular 0x27. % \def\codequoteright{% - \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax - \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax - '% + \ifmonospace + \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% + \else \char'15 \fi \else \char'15 \fi - \else \char'15 \fi + \else + '% + \fi } % % and a similar option for the left quote char vs. a grave accent. @@ -2712,13 +2683,17 @@ end % the code environments to do likewise. % \def\codequoteleft{% - \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax - \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax - % [Knuth] pp. 380,381,391 - % \relax disables Spanish ligatures ?` and !` of \tt font. - \relax`% + \ifmonospace + \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax + \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax + % [Knuth] pp. 380,381,391 + % \relax disables Spanish ligatures ?` and !` of \tt font. + \relax`% + \else \char'22 \fi \else \char'22 \fi - \else \char'22 \fi + \else + \relax`% + \fi } % Commands to set the quote options. @@ -5969,24 +5944,30 @@ end % Split the last of the double-column material. \savemarks \balancecolumns - % + }% + \eject % call the \output just set + \ifdim\pagetotal=0pt % Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal % definition right away. \global\output = {\onepageout{\pagecontents\PAGE}}% - }% - \eject - \endgroup % started in \begindoublecolumns - \restoremarks - % Leave the double-column material on the current page, no automatic - % page break. - \box\balancedcolumns - % - % \pagegoal was set to the doubled \vsize above, since we restarted - % the current page. We're now back to normal single-column - % typesetting, so reset \pagegoal to the normal \vsize. - \global\vsize = \txipageheight % - \pagegoal = \txipageheight % + % + \endgroup % started in \begindoublecolumns + \restoremarks + % Leave the double-column material on the current page, no automatic + % page break. + \box\balancedcolumns + % + % \pagegoal was set to the doubled \vsize above, since we restarted + % the current page. We're now back to normal single-column + % typesetting, so reset \pagegoal to the normal \vsize. + \global\vsize = \txipageheight % + \pagegoal = \txipageheight % + \else + % We had some left-over material. This might happen when \doublecolumnout + % is called in \balancecolumns. Try again. + \expandafter\enddoublecolumns + \fi } \newbox\balancedcolumns \setbox\balancedcolumns=\vbox{shouldnt see this}% @@ -6001,6 +5982,7 @@ end \ifdim\dimen@<5\baselineskip % Don't split a short final column in two. \setbox2=\vbox{}% + \global\setbox\balancedcolumns=\vbox{\pagesofar}% \else \divide\dimen@ by 2 % target to split to \dimen@ii = \dimen@ @@ -6016,15 +5998,15 @@ end \repeat }% % Now the left column is in box 1, and the right column in box 3. + % % Check whether the left column has come out higher than the page itself. % (Note that we have doubled \vsize for the double columns, so % the actual height of the page is 0.5\vsize). \ifdim2\ht1>\vsize - % Just split the last of the double column material roughly in half. - \setbox2=\box0 - \setbox0 = \vsplit2 to \dimen@ii - \setbox0=\vbox to \dimen@ii {\unvbox0\vfill}% - \setbox2=\vbox to \dimen@ii {\unvbox2\vfill}% + % It appears that we have been called upon to balance too much material. + % Output some of it with \doublecolumnout, leaving the rest on the page. + \setbox\PAGE=\box0 + \doublecolumnout \else % Compare the heights of the two columns. \ifdim4\ht1>5\ht3 @@ -6037,10 +6019,10 @@ end \setbox2=\vbox to\ht1{\unvbox3\unskip}% \setbox0=\vbox to\ht1{\unvbox1\unskip}% \fi + \global\setbox\balancedcolumns=\vbox{\pagesofar}% \fi \fi % - \global\setbox\balancedcolumns=\vbox{\pagesofar}% } \catcode`\@ = \other @@ -7963,6 +7945,7 @@ end \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} \gdef\magicamp{\let&=\amprm} } +\let\ampchar\& \newcount\parencount @@ -11677,7 +11660,7 @@ directory should work if nowhere else does.} @markupsetuprqdefault @c Local variables: -@c eval: (add-hook 'write-file-hooks 'time-stamp) +@c eval: (add-hook 'before-save-hook 'time-stamp) @c page-delimiter: "^\\\\message\\|emacs-page" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" diff --git a/build-aux/ylwrap b/build-aux/ylwrap index 8f072a8e97c00490c74a591edc511af919584adf..7c2d927f7f67970737afa04378850c0c9859688f 100755 --- a/build-aux/ylwrap +++ b/build-aux/ylwrap @@ -3,7 +3,7 @@ scriptversion=2013-01-12.17; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # Written by Tom Tromey . # diff --git a/config.h.in b/config.h.in index 5d2301dc0546dde1947e0d1d8beca96d3b0c396f..a954dee8bad65c7d95eae3caf22f759ead9fd8d6 100644 --- a/config.h.in +++ b/config.h.in @@ -1,80 +1,5 @@ /* config.h.in. Generated from configure.ac by autoheader. */ -/* CPU and C ABI indicator */ -#ifndef __i386__ -#undef __i386__ -#endif -#ifndef __x86_64_x32__ -#undef __x86_64_x32__ -#endif -#ifndef __x86_64__ -#undef __x86_64__ -#endif -#ifndef __alpha__ -#undef __alpha__ -#endif -#ifndef __arm__ -#undef __arm__ -#endif -#ifndef __armhf__ -#undef __armhf__ -#endif -#ifndef __arm64_ilp32__ -#undef __arm64_ilp32__ -#endif -#ifndef __arm64__ -#undef __arm64__ -#endif -#ifndef __hppa__ -#undef __hppa__ -#endif -#ifndef __hppa64__ -#undef __hppa64__ -#endif -#ifndef __ia64_ilp32__ -#undef __ia64_ilp32__ -#endif -#ifndef __ia64__ -#undef __ia64__ -#endif -#ifndef __m68k__ -#undef __m68k__ -#endif -#ifndef __mips__ -#undef __mips__ -#endif -#ifndef __mipsn32__ -#undef __mipsn32__ -#endif -#ifndef __mips64__ -#undef __mips64__ -#endif -#ifndef __powerpc__ -#undef __powerpc__ -#endif -#ifndef __powerpc64__ -#undef __powerpc64__ -#endif -#ifndef __powerpc64_elfv2__ -#undef __powerpc64_elfv2__ -#endif -#ifndef __s390__ -#undef __s390__ -#endif -#ifndef __s390x__ -#undef __s390x__ -#endif -#ifndef __sh__ -#undef __sh__ -#endif -#ifndef __sparc__ -#undef __sparc__ -#endif -#ifndef __sparc64__ -#undef __sparc64__ -#endif - - /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD @@ -168,6 +93,10 @@ /* Define if struct dirent has a member d_ino that actually works. */ #undef D_INO_IN_DIRENT +/* Enable the use of error_print_progname to print program name with error + messages. See comment to function tar_print_progname in src/tar.c */ +#undef ENABLE_ERROR_PRINT_PROGNAME + /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS @@ -269,6 +198,10 @@ whether the gnulib module fchownat shall be considered present. */ #undef GNULIB_FCHOWNAT +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module fcntl-safer shall be considered present. */ +#undef GNULIB_FCNTL_SAFER + /* Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module fdopendir shall be considered present. */ #undef GNULIB_FDOPENDIR @@ -281,6 +214,10 @@ whether the gnulib module fd-safer-flag shall be considered present. */ #undef GNULIB_FD_SAFER_FLAG +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module fnmatch-gnu shall be considered present. */ +#undef GNULIB_FNMATCH_GNU + /* Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module fscanf shall be considered present. */ #undef GNULIB_FSCANF @@ -301,6 +238,10 @@ whether the gnulib module openat shall be considered present. */ #undef GNULIB_OPENAT +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module openat-safer shall be considered present. */ +#undef GNULIB_OPENAT_SAFER + /* enable some gnulib portability checks */ #undef GNULIB_PORTCHECK @@ -387,6 +328,9 @@ /* Define to 1 when the gnulib module fdopendir should be tested. */ #undef GNULIB_TEST_FDOPENDIR +/* Define to 1 when the gnulib module fnmatch should be tested. */ +#undef GNULIB_TEST_FNMATCH + /* Define to 1 when the gnulib module fseek should be tested. */ #undef GNULIB_TEST_FSEEK @@ -729,6 +673,10 @@ CoreFoundation framework. */ #undef HAVE_CFLOCALECOPYCURRENT +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +#undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES + /* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE @@ -963,6 +911,10 @@ don't. */ #undef HAVE_DECL_WCWIDTH +/* Define to 1 if you have the declaration of `_fseeki64', and to 0 if you + don't. */ +#undef HAVE_DECL__FSEEKI64 + /* Define to 1 if you have the declaration of `_snprintf', and to 0 if you don't. */ #undef HAVE_DECL__SNPRINTF @@ -1026,6 +978,12 @@ /* Define to 1 if you have the `flockfile' function. */ #undef HAVE_FLOCKFILE +/* Define to 1 if you have the `fnmatch' function. */ +#undef HAVE_FNMATCH + +/* Define to 1 if you have the header file. */ +#undef HAVE_FNMATCH_H + /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO @@ -1075,7 +1033,7 @@ /* Define to 1 if you have the `getopt_long_only' function. */ #undef HAVE_GETOPT_LONG_ONLY -/* Define to 1 if you have the `getpagesize' function. */ +/* Define to 1 if the system has the 'getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if you have the `getppriv' function. */ @@ -1163,6 +1121,10 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H +/* Define if localtime-like functions can loop forever on extreme arguments. + */ +#undef HAVE_LOCALTIME_INFLOOP_BUG + /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R @@ -1248,9 +1210,6 @@ concept. */ #undef HAVE_MSVC_INVALID_PARAMETER_HANDLER -/* Define to 1 if you have the `nanotime' function. */ -#undef HAVE_NANOTIME - /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H @@ -1303,610 +1262,6 @@ /* Define to 1 if you have the `rawmemchr' function. */ #undef HAVE_RAWMEMCHR -/* Define to 1 if alphasort is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_ALPHASORT - -/* Define to 1 if atoll is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_ATOLL - -/* Define to 1 if btowc is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_BTOWC - -/* Define to 1 if canonicalize_file_name is declared even after undefining - macros. */ -#undef HAVE_RAW_DECL_CANONICALIZE_FILE_NAME - -/* Define to 1 if chdir is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_CHDIR - -/* Define to 1 if chown is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_CHOWN - -/* Define to 1 if closedir is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_CLOSEDIR - -/* Define to 1 if dirfd is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_DIRFD - -/* Define to 1 if dprintf is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_DPRINTF - -/* Define to 1 if dup is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_DUP - -/* Define to 1 if dup2 is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_DUP2 - -/* Define to 1 if dup3 is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_DUP3 - -/* Define to 1 if duplocale is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_DUPLOCALE - -/* Define to 1 if endusershell is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_ENDUSERSHELL - -/* Define to 1 if environ is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_ENVIRON - -/* Define to 1 if euidaccess is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_EUIDACCESS - -/* Define to 1 if faccessat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FACCESSAT - -/* Define to 1 if fchdir is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FCHDIR - -/* Define to 1 if fchmodat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FCHMODAT - -/* Define to 1 if fchownat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FCHOWNAT - -/* Define to 1 if fcntl is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FCNTL - -/* Define to 1 if fdatasync is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FDATASYNC - -/* Define to 1 if fdopendir is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FDOPENDIR - -/* Define to 1 if ffs is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FFS - -/* Define to 1 if ffsl is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FFSL - -/* Define to 1 if ffsll is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FFSLL - -/* Define to 1 if fpurge is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FPURGE - -/* Define to 1 if fseeko is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FSEEKO - -/* Define to 1 if fstat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FSTAT - -/* Define to 1 if fstatat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FSTATAT - -/* Define to 1 if fsync is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FSYNC - -/* Define to 1 if ftello is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FTELLO - -/* Define to 1 if ftruncate is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FTRUNCATE - -/* Define to 1 if futimens is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_FUTIMENS - -/* Define to 1 if getcwd is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GETCWD - -/* Define to 1 if getdelim is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GETDELIM - -/* Define to 1 if getdomainname is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GETDOMAINNAME - -/* Define to 1 if getdtablesize is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GETDTABLESIZE - -/* Define to 1 if getgroups is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GETGROUPS - -/* Define to 1 if gethostname is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GETHOSTNAME - -/* Define to 1 if getline is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GETLINE - -/* Define to 1 if getloadavg is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GETLOADAVG - -/* Define to 1 if getlogin is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GETLOGIN - -/* Define to 1 if getlogin_r is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GETLOGIN_R - -/* Define to 1 if getpagesize is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GETPAGESIZE - -/* Define to 1 if gets is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GETS - -/* Define to 1 if getsubopt is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GETSUBOPT - -/* Define to 1 if gettimeofday is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GETTIMEOFDAY - -/* Define to 1 if getusershell is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GETUSERSHELL - -/* Define to 1 if grantpt is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GRANTPT - -/* Define to 1 if group_member is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_GROUP_MEMBER - -/* Define to 1 if imaxabs is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_IMAXABS - -/* Define to 1 if imaxdiv is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_IMAXDIV - -/* Define to 1 if initstate is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_INITSTATE - -/* Define to 1 if initstate_r is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_INITSTATE_R - -/* Define to 1 if isatty is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_ISATTY - -/* Define to 1 if iswctype is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_ISWCTYPE - -/* Define to 1 if lchmod is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_LCHMOD - -/* Define to 1 if lchown is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_LCHOWN - -/* Define to 1 if link is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_LINK - -/* Define to 1 if linkat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_LINKAT - -/* Define to 1 if lseek is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_LSEEK - -/* Define to 1 if lstat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_LSTAT - -/* Define to 1 if mbrlen is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MBRLEN - -/* Define to 1 if mbrtowc is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MBRTOWC - -/* Define to 1 if mbsinit is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MBSINIT - -/* Define to 1 if mbsnrtowcs is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MBSNRTOWCS - -/* Define to 1 if mbsrtowcs is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MBSRTOWCS - -/* Define to 1 if memmem is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MEMMEM - -/* Define to 1 if mempcpy is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MEMPCPY - -/* Define to 1 if memrchr is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MEMRCHR - -/* Define to 1 if mkdirat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MKDIRAT - -/* Define to 1 if mkdtemp is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MKDTEMP - -/* Define to 1 if mkfifo is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MKFIFO - -/* Define to 1 if mkfifoat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MKFIFOAT - -/* Define to 1 if mknod is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MKNOD - -/* Define to 1 if mknodat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MKNODAT - -/* Define to 1 if mkostemp is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MKOSTEMP - -/* Define to 1 if mkostemps is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MKOSTEMPS - -/* Define to 1 if mkstemp is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MKSTEMP - -/* Define to 1 if mkstemps is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_MKSTEMPS - -/* Define to 1 if nl_langinfo is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_NL_LANGINFO - -/* Define to 1 if openat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_OPENAT - -/* Define to 1 if opendir is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_OPENDIR - -/* Define to 1 if pclose is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_PCLOSE - -/* Define to 1 if pipe is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_PIPE - -/* Define to 1 if pipe2 is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_PIPE2 - -/* Define to 1 if popen is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_POPEN - -/* Define to 1 if posix_openpt is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_POSIX_OPENPT - -/* Define to 1 if pread is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_PREAD - -/* Define to 1 if pthread_sigmask is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_PTHREAD_SIGMASK - -/* Define to 1 if ptsname is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_PTSNAME - -/* Define to 1 if ptsname_r is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_PTSNAME_R - -/* Define to 1 if pwrite is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_PWRITE - -/* Define to 1 if qsort_r is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_QSORT_R - -/* Define to 1 if random is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_RANDOM - -/* Define to 1 if random_r is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_RANDOM_R - -/* Define to 1 if rawmemchr is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_RAWMEMCHR - -/* Define to 1 if readdir is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_READDIR - -/* Define to 1 if readlink is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_READLINK - -/* Define to 1 if readlinkat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_READLINKAT - -/* Define to 1 if reallocarray is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_REALLOCARRAY - -/* Define to 1 if realpath is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_REALPATH - -/* Define to 1 if renameat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_RENAMEAT - -/* Define to 1 if rewinddir is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_REWINDDIR - -/* Define to 1 if rmdir is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_RMDIR - -/* Define to 1 if rpmatch is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_RPMATCH - -/* Define to 1 if scandir is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SCANDIR - -/* Define to 1 if secure_getenv is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SECURE_GETENV - -/* Define to 1 if setenv is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SETENV - -/* Define to 1 if sethostname is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SETHOSTNAME - -/* Define to 1 if setlocale is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SETLOCALE - -/* Define to 1 if setstate is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SETSTATE - -/* Define to 1 if setstate_r is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SETSTATE_R - -/* Define to 1 if setusershell is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SETUSERSHELL - -/* Define to 1 if sigaction is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SIGACTION - -/* Define to 1 if sigaddset is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SIGADDSET - -/* Define to 1 if sigdelset is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SIGDELSET - -/* Define to 1 if sigemptyset is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SIGEMPTYSET - -/* Define to 1 if sigfillset is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SIGFILLSET - -/* Define to 1 if sigismember is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SIGISMEMBER - -/* Define to 1 if sigpending is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SIGPENDING - -/* Define to 1 if sigprocmask is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SIGPROCMASK - -/* Define to 1 if sleep is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SLEEP - -/* Define to 1 if snprintf is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SNPRINTF - -/* Define to 1 if srandom is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SRANDOM - -/* Define to 1 if srandom_r is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SRANDOM_R - -/* Define to 1 if stat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STAT - -/* Define to 1 if stpcpy is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STPCPY - -/* Define to 1 if stpncpy is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STPNCPY - -/* Define to 1 if strcasecmp is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRCASECMP - -/* Define to 1 if strcasestr is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRCASESTR - -/* Define to 1 if strchrnul is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRCHRNUL - -/* Define to 1 if strdup is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRDUP - -/* Define to 1 if strerror_r is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRERROR_R - -/* Define to 1 if strncasecmp is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRNCASECMP - -/* Define to 1 if strncat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRNCAT - -/* Define to 1 if strndup is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRNDUP - -/* Define to 1 if strnlen is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRNLEN - -/* Define to 1 if strpbrk is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRPBRK - -/* Define to 1 if strsep is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRSEP - -/* Define to 1 if strsignal is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRSIGNAL - -/* Define to 1 if strtod is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRTOD - -/* Define to 1 if strtoimax is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRTOIMAX - -/* Define to 1 if strtok_r is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRTOK_R - -/* Define to 1 if strtoll is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRTOLL - -/* Define to 1 if strtoull is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRTOULL - -/* Define to 1 if strtoumax is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRTOUMAX - -/* Define to 1 if strverscmp is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_STRVERSCMP - -/* Define to 1 if symlink is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SYMLINK - -/* Define to 1 if symlinkat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_SYMLINKAT - -/* Define to 1 if tmpfile is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_TMPFILE - -/* Define to 1 if towctrans is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_TOWCTRANS - -/* Define to 1 if truncate is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_TRUNCATE - -/* Define to 1 if ttyname_r is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_TTYNAME_R - -/* Define to 1 if unlink is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_UNLINK - -/* Define to 1 if unlinkat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_UNLINKAT - -/* Define to 1 if unlockpt is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_UNLOCKPT - -/* Define to 1 if unsetenv is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_UNSETENV - -/* Define to 1 if usleep is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_USLEEP - -/* Define to 1 if utime is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_UTIME - -/* Define to 1 if utimensat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_UTIMENSAT - -/* Define to 1 if vdprintf is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_VDPRINTF - -/* Define to 1 if vsnprintf is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_VSNPRINTF - -/* Define to 1 if wcpcpy is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCPCPY - -/* Define to 1 if wcpncpy is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCPNCPY - -/* Define to 1 if wcrtomb is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCRTOMB - -/* Define to 1 if wcscasecmp is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSCASECMP - -/* Define to 1 if wcscat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSCAT - -/* Define to 1 if wcschr is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSCHR - -/* Define to 1 if wcscmp is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSCMP - -/* Define to 1 if wcscoll is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSCOLL - -/* Define to 1 if wcscpy is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSCPY - -/* Define to 1 if wcscspn is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSCSPN - -/* Define to 1 if wcsdup is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSDUP - -/* Define to 1 if wcsftime is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSFTIME - -/* Define to 1 if wcslen is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSLEN - -/* Define to 1 if wcsncasecmp is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSNCASECMP - -/* Define to 1 if wcsncat is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSNCAT - -/* Define to 1 if wcsncmp is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSNCMP - -/* Define to 1 if wcsncpy is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSNCPY - -/* Define to 1 if wcsnlen is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSNLEN - -/* Define to 1 if wcsnrtombs is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSNRTOMBS - -/* Define to 1 if wcspbrk is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSPBRK - -/* Define to 1 if wcsrchr is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSRCHR - -/* Define to 1 if wcsrtombs is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSRTOMBS - -/* Define to 1 if wcsspn is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSSPN - -/* Define to 1 if wcsstr is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSSTR - -/* Define to 1 if wcstok is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSTOK - -/* Define to 1 if wcswidth is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSWIDTH - -/* Define to 1 if wcsxfrm is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCSXFRM - -/* Define to 1 if wctob is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCTOB - -/* Define to 1 if wctrans is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCTRANS - -/* Define to 1 if wctype is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCTYPE - -/* Define to 1 if wcwidth is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WCWIDTH - -/* Define to 1 if wmemchr is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WMEMCHR - -/* Define to 1 if wmemcmp is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WMEMCMP - -/* Define to 1 if wmemcpy is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WMEMCPY - -/* Define to 1 if wmemmove is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WMEMMOVE - -/* Define to 1 if wmemset is declared even after undefining macros. */ -#undef HAVE_RAW_DECL_WMEMSET - -/* Define to 1 if _Exit is declared even after undefining macros. */ -#undef HAVE_RAW_DECL__EXIT - /* Define to 1 if you have the `readdir' function. */ #undef HAVE_READDIR @@ -1925,6 +1280,9 @@ /* Define to 1 if you have the `renameat' function. */ #undef HAVE_RENAMEAT +/* Define to 1 if you have the `renameat2' function. */ +#undef HAVE_RENAMEAT2 + /* Define to 1 if you have the `rewinddir' function. */ #undef HAVE_REWINDDIR @@ -2294,6 +1652,9 @@ #endif +/* Define to 1 if the compiler supports the keyword '__inline'. */ +#undef HAVE___INLINE + /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST @@ -2587,6 +1948,11 @@ #ifndef _XOPEN_SOURCE # undef _XOPEN_SOURCE #endif +/* Enable X/Open compliant socket functions that do not require linking + with -lxnet on HP-UX 11.11. */ +#ifndef _HPUX_ALT_XOPEN_SOCKET_API +# undef _HPUX_ALT_XOPEN_SOCKET_API +#endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ @@ -2627,6 +1993,9 @@ /* Define to the program name of xz compressor program */ #undef XZ_PROGRAM +/* Define to the program name of zstd compressor program */ +#undef ZSTD_PROGRAM + /* Enable large inode numbers on Mac OS X 10.5. */ #undef _DARWIN_USE_64_BIT_INODE @@ -2649,12 +2018,15 @@ #undef _NETBSD_SOURCE /* The _Noreturn keyword of C11. */ -#if ! (defined _Noreturn \ - || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) -# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ - || 0x5110 <= __SUNPRO_C) +#ifndef _Noreturn +# if 201103 <= (defined __cplusplus ? __cplusplus : 0) +# define _Noreturn [[noreturn]] +# elif (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ + || 4 < __GNUC__ + (7 <= __GNUC_MINOR__)) + /* _Noreturn works as-is. */ +# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C # define _Noreturn __attribute__ ((__noreturn__)) -# elif defined _MSC_VER && 1200 <= _MSC_VER +# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0) # define _Noreturn __declspec (noreturn) # else # define _Noreturn @@ -2709,7 +2081,8 @@ if isdigit is mistakenly implemented via a static inline function, a program containing an extern inline function that calls isdigit may not work since the C standard prohibits extern inline functions - from calling static functions. This bug is known to occur on: + from calling static functions (ISO C 99 section 6.7.4.(3). + This bug is known to occur on: OS X 10.8 and earlier; see: https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html @@ -2722,7 +2095,18 @@ OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and for clang but remains for g++; see . - Assume DragonFly and FreeBSD will be similar. */ + Assume DragonFly and FreeBSD will be similar. + + GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 + inline semantics, unless -fgnu89-inline is used. It defines a macro + __GNUC_STDC_INLINE__ to indicate this situation or a macro + __GNUC_GNU_INLINE__ to indicate the opposite situation. + GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline + semantics but warns, unless -fgnu89-inline is used: + warning: C99 inline functions are not supported; using GNU89 + warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute + It defines a macro __GNUC_GNU_INLINE__ to indicate this situation. + */ #if (((defined __APPLE__ && defined __MACH__) \ || defined __DragonFly__ || defined __FreeBSD__) \ && (defined __header_inline \ @@ -2787,9 +2171,6 @@ /* Always use our fgetfilecon wrapper. */ #undef fgetfilecon -/* Define to a replacement function name for fnmatch(). */ -#undef fnmatch - /* Always use our getfilecon wrapper. */ #undef getfilecon @@ -2965,6 +2346,13 @@ # define _GL_ATTRIBUTE_CONST /* empty */ #endif +/* The __malloc__ attribute was added in gcc 3. */ +#if 3 <= __GNUC__ +# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) +#else +# define _GL_ATTRIBUTE_MALLOC /* empty */ +#endif + /* Define as a macro for copying va_list variables. */ #undef va_copy diff --git a/configure b/configure index c8cc0a248931c9af129d2a965ede1052180d9a83..81b35017cb6def0e0cd6fb8cca9ce980f2b74ffb 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for GNU tar 1.30. +# Generated by GNU Autoconf 2.69 for GNU tar 1.32. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='GNU tar' PACKAGE_TARNAME='tar' -PACKAGE_VERSION='1.30' -PACKAGE_STRING='GNU tar 1.30' +PACKAGE_VERSION='1.32' +PACKAGE_STRING='GNU tar 1.32' PACKAGE_BUGREPORT='bug-tar@gnu.org' PACKAGE_URL='http://www.gnu.org/software/tar/' @@ -735,6 +735,7 @@ SELINUX_CONTEXT_H NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H NEXT_SELINUX_SELINUX_H LIB_SELINUX +GLIBC21 REPLACE_RAISE REPLACE_PTHREAD_SIGMASK HAVE_SIGHANDLER_T @@ -845,17 +846,22 @@ HAVE_WCHAR_T HAVE_MAX_ALIGN_T REPLACE_NULL REPLACE_STRUCT_LCONV +REPLACE_FREELOCALE REPLACE_DUPLOCALE +REPLACE_NEWLOCALE REPLACE_SETLOCALE REPLACE_LOCALECONV +HAVE_FREELOCALE HAVE_DUPLOCALE +HAVE_NEWLOCALE +GNULIB_LOCALENAME GNULIB_DUPLOCALE GNULIB_SETLOCALE GNULIB_LOCALECONV LOCALCHARSET_TESTS_ENVIRONMENT -GLIBC21 HAVE_LANGINFO_YESEXPR HAVE_LANGINFO_ERA +HAVE_LANGINFO_ALTMON HAVE_LANGINFO_T_FMT_AMPM HAVE_LANGINFO_CODESET HAVE_LANGINFO_H @@ -891,6 +897,7 @@ INT64_MAX_EQ_LONG_MAX INT32_MAX_LT_INTMAX_MAX REPLACE_STRTOUMAX REPLACE_STRTOIMAX +HAVE_IMAXDIV_T HAVE_DECL_STRTOUMAX HAVE_DECL_STRTOIMAX HAVE_DECL_IMAXDIV @@ -933,8 +940,6 @@ GL_GENERATE_LIMITS_H_TRUE LIMITS_H NEXT_AS_FIRST_DIRECTIVE_LIMITS_H NEXT_LIMITS_H -HOST_CPU_C_ABI -HOST_CPU REPLACE_LOCALTIME REPLACE_GMTIME REPLACE_TZSET @@ -1089,6 +1094,12 @@ GNULIB_DPRINTF GL_GENERATE_FNMATCH_H_FALSE GL_GENERATE_FNMATCH_H_TRUE FNMATCH_H +HAVE_FNMATCH_H +NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H +NEXT_FNMATCH_H +REPLACE_FNMATCH +HAVE_FNMATCH +GNULIB_FNMATCH REPLACE_ITOLD GL_GENERATE_FLOAT_H_FALSE GL_GENERATE_FLOAT_H_TRUE @@ -1209,6 +1220,7 @@ REPLACE_LINKAT REPLACE_LINK REPLACE_LCHOWN REPLACE_ISATTY +REPLACE_GETPASS REPLACE_GETPAGESIZE REPLACE_GETGROUPS REPLACE_GETLOGIN_R @@ -1225,6 +1237,7 @@ REPLACE_CHOWN HAVE_SYS_PARAM_H HAVE_OS_H HAVE_DECL_TTYNAME_R +HAVE_DECL_TRUNCATE HAVE_DECL_SETHOSTNAME HAVE_DECL_GETUSERSHELL HAVE_DECL_GETPAGESIZE @@ -1236,7 +1249,6 @@ HAVE_DECL_FCHDIR HAVE_DECL_ENVIRON HAVE_USLEEP HAVE_UNLINKAT -HAVE_TRUNCATE HAVE_SYMLINKAT HAVE_SYMLINK HAVE_SLEEP @@ -1251,6 +1263,7 @@ HAVE_LINKAT HAVE_LINK HAVE_LCHOWN HAVE_GROUP_MEMBER +HAVE_GETPASS HAVE_GETPAGESIZE HAVE_GETLOGIN HAVE_GETHOSTNAME @@ -1293,6 +1306,7 @@ GNULIB_LCHOWN GNULIB_ISATTY GNULIB_GROUP_MEMBER GNULIB_GETUSERSHELL +GNULIB_GETPASS GNULIB_GETPAGESIZE GNULIB_GETLOGIN_R GNULIB_GETLOGIN @@ -1623,6 +1637,7 @@ with_lzip with_lzma with_lzop with_xz +with_zstd with_gnu_ld enable_rpath with_libiconv_prefix @@ -2187,7 +2202,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GNU tar 1.30 to adapt to many kinds of systems. +\`configure' configures GNU tar 1.32 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2257,7 +2272,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU tar 1.30:";; + short | recursive ) echo "Configuration of GNU tar 1.32:";; esac cat <<\_ACEOF @@ -2302,6 +2317,7 @@ Optional Packages: --with-lzma=PROG use PROG as lzma compressor program --with-lzop=PROG use PROG as lzop compressor program --with-xz=PROG use PROG as xz compressor program + --with-zstd=PROG use PROG as zstd compressor program --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir @@ -2407,7 +2423,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GNU tar configure 1.30 +GNU tar configure 1.32 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -3116,7 +3132,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GNU tar $as_me 1.30, which was +It was created by GNU tar $as_me 1.32, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3439,6 +3455,8 @@ as_fn_append ac_func_list " lchmod" as_fn_append ac_func_list " fcntl" as_fn_append ac_func_list " symlink" as_fn_append ac_func_list " mempcpy" +as_fn_append ac_header_list " fnmatch.h" +as_fn_append ac_func_list " fnmatch" as_fn_append ac_func_list " isblank" as_fn_append ac_func_list " iswctype" as_fn_append ac_func_list " mbsrtowcs" @@ -3459,7 +3477,6 @@ as_fn_append ac_header_list " sys/cdefs.h" as_fn_append ac_func_list " getprogname" as_fn_append ac_func_list " getexecname" as_fn_append ac_func_list " gettimeofday" -as_fn_append ac_func_list " nanotime" as_fn_append ac_header_list " limits.h" as_fn_append ac_header_list " wchar.h" as_fn_append ac_header_list " stdint.h" @@ -3478,7 +3495,6 @@ as_fn_append ac_func_list " mbrtowc" as_fn_append ac_header_list " sys/mman.h" as_fn_append ac_func_list " mprotect" as_fn_append ac_func_list " mkdirat" -as_fn_append ac_func_list " mkfifo" as_fn_append ac_func_list " mkfifoat" as_fn_append ac_func_list " mknodat" as_fn_append ac_func_list " mknod" @@ -3487,6 +3503,7 @@ as_fn_append ac_func_list " nl_langinfo" as_fn_append ac_header_list " priv.h" as_fn_append ac_header_list " malloc.h" as_fn_append ac_func_list " renameat" +as_fn_append ac_func_list " renameat2" as_fn_append ac_header_list " selinux/selinux.h" as_fn_append ac_func_list " setenv" as_fn_append ac_func_list " sleep" @@ -3515,6 +3532,7 @@ as_fn_append ac_header_list " netdb.h" as_fn_append ac_header_list " sys/wait.h" as_fn_append ac_header_list " pwd.h" as_fn_append ac_header_list " grp.h" +as_fn_append ac_func_list " mkfifo" as_fn_append ac_func_list " setlocale" as_fn_append ac_func_list " fsync" gt_needs="$gt_needs need-formatstring-macros" @@ -3619,7 +3637,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ac_config_headers="$ac_config_headers config.h" -am__api_version='1.14' +am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -3791,8 +3809,8 @@ test "$program_suffix" != NONE && ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in @@ -3811,7 +3829,7 @@ else $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -4105,7 +4123,7 @@ fi # Define the identity of the package. PACKAGE='tar' - VERSION='1.30' + VERSION='1.32' cat >>confdefs.h <<_ACEOF @@ -4139,8 +4157,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' @@ -4314,6 +4332,7 @@ END fi fi + # Enable silent rules by default: # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : @@ -6351,6 +6370,8 @@ $as_echo "$ac_cv_should_define__xopen_source" >&6; } test $ac_cv_should_define__xopen_source = yes && $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h + $as_echo "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h + @@ -6933,6 +6954,7 @@ fi # Code from module fchownat: # Code from module fcntl: # Code from module fcntl-h: + # Code from module fcntl-safer: # Code from module fd-hook: # Code from module fd-safer-flag: # Code from module fdopendir: @@ -6945,6 +6967,7 @@ fi # Code from module float: # Code from module fnmatch: # Code from module fnmatch-gnu: + # Code from module fnmatch-h: # Code from module fpending: # Code from module fprintftime: # Code from module fseek: @@ -6973,7 +6996,6 @@ fi # Code from module hard-locale: # Code from module hash: # Code from module havelib: - # Code from module host-cpu-c-abi: # Code from module human: # Code from module include_next: # Code from module intprops: @@ -6985,6 +7007,7 @@ fi # Code from module largefile: # Code from module lchown: + # Code from module libc-config: # Code from module limits-h: # Code from module link: # Code from module link-follow: @@ -7030,7 +7053,9 @@ fi # Code from module openat: # Code from module openat-die: # Code from module openat-h: + # Code from module openat-safer: # Code from module opendir: + # Code from module opendirat: # Code from module parse-datetime: # Code from module pathmax: # Code from module priv-set: @@ -7048,7 +7073,7 @@ fi # Code from module regex: # Code from module rename: # Code from module renameat: - # Code from module renameat2: + # Code from module renameatu: # Code from module rewinddir: # Code from module rmdir: # Code from module root-uid: @@ -8111,17 +8136,17 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ typedef int *int_ptr; - int foo (int_ptr $ac_kw ip) { return ip[0]; } - int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ - int bar (int ip[$ac_kw]) { return ip[0]; } + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } int main () { int s[1]; - int *$ac_kw t = s; - t[0] = 0; - return foo (t) + bar (t); + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); ; return 0; @@ -8693,7 +8718,8 @@ int main () { return zero(); } _ACEOF save_ac_compile="$ac_compile" ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if echo '#include "conftest.c"' >conftest1.c && + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 @@ -8714,7 +8740,8 @@ int zero (void) { return 0; } _ACEOF ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if echo '#include "conftest.c"' >conftest2.c && + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 @@ -8727,7 +8754,7 @@ _ACEOF fi fi ac_compile="$save_ac_compile" - rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext + rm -f conftest12.c conftest12.$ac_objext conftest$ac_exeext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5 @@ -8809,7 +8836,7 @@ int main () { return 1; #else /* Check whether the given locale name is recognized by the system. */ -# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ +# if defined _WIN32 && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE @@ -9143,7 +9170,7 @@ nocrash_init (void) } } } -#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#elif defined _WIN32 && ! defined __CYGWIN__ /* Avoid a crash on native Windows. */ #define WIN32_LEAN_AND_MEAN #include @@ -9288,6 +9315,7 @@ $as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h GNULIB_GETLOGIN=0; GNULIB_GETLOGIN_R=0; GNULIB_GETPAGESIZE=0; + GNULIB_GETPASS=0; GNULIB_GETUSERSHELL=0; GNULIB_GROUP_MEMBER=0; GNULIB_ISATTY=0; @@ -9330,6 +9358,7 @@ $as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h HAVE_GETHOSTNAME=1; HAVE_GETLOGIN=1; HAVE_GETPAGESIZE=1; + HAVE_GETPASS=1; HAVE_GROUP_MEMBER=1; HAVE_LCHOWN=1; HAVE_LINK=1; @@ -9344,7 +9373,6 @@ $as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h HAVE_SLEEP=1; HAVE_SYMLINK=1; HAVE_SYMLINKAT=1; - HAVE_TRUNCATE=1; HAVE_UNLINKAT=1; HAVE_USLEEP=1; HAVE_DECL_ENVIRON=1; @@ -9356,6 +9384,7 @@ $as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h HAVE_DECL_GETPAGESIZE=1; HAVE_DECL_GETUSERSHELL=1; HAVE_DECL_SETHOSTNAME=1; + HAVE_DECL_TRUNCATE=1; HAVE_DECL_TTYNAME_R=1; HAVE_OS_H=0; HAVE_SYS_PARAM_H=0; @@ -9372,6 +9401,7 @@ $as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h REPLACE_GETLOGIN_R=0; REPLACE_GETGROUPS=0; REPLACE_GETPAGESIZE=0; + REPLACE_GETPASS=0; REPLACE_ISATTY=0; REPLACE_LCHOWN=0; REPLACE_LINK=0; @@ -9419,12 +9449,14 @@ if ${ac_cv_func_chown_works+:} false; then : else if test "$cross_compiling" = yes; then : case "$host_os" in # (( - # Guess yes on glibc systems. - *-gnu*) ac_cv_func_chown_works="guessing yes" ;; - # Guess no on native Windows. - mingw*) ac_cv_func_chown_works="guessing no" ;; - # If we don't know, assume the worst. - *) ac_cv_func_chown_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) ac_cv_func_chown_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) ac_cv_func_chown_works="guessing yes" ;; + # Guess no on native Windows. + mingw*) ac_cv_func_chown_works="guessing no" ;; + # If we don't know, assume the worst. + *) ac_cv_func_chown_works="guessing no" ;; esac else @@ -9852,11 +9884,10 @@ $as_echo "$gl_cv_pragma_columns" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5 $as_echo_n "checking if environ is properly declared... " >&6; } - if ${gt_cv_var_environ_declaration+:} false; then : +if ${gt_cv_var_environ_declaration+:} false; then : $as_echo_n "(cached) " >&6 else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_UNISTD_H #include @@ -9864,7 +9895,7 @@ else /* mingw, BeOS, Haiku declare environ in , not in . */ #include - extern struct { int foo; } environ; + extern struct { int foo; } environ; int main () { @@ -9880,8 +9911,7 @@ else fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5 $as_echo "$gt_cv_var_environ_declaration" >&6; } if test $gt_cv_var_environ_declaration = yes; then @@ -10352,7 +10382,10 @@ else echo >conftest.file if test "$cross_compiling" = yes; then : case "$host_os" in - *-gnu*) + linux-* | linux) + # Guess yes on Linux systems. + gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; + *-gnu* | gnu*) # Guess yes on glibc systems. gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; mingw*) @@ -10626,6 +10659,165 @@ _ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5 +$as_echo_n "checking for promoted mode_t type... " >&6; } +if ${gl_cv_promoted_mode_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_promoted_mode_t='int' +else + gl_cv_promoted_mode_t='mode_t' +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5 +$as_echo "$gl_cv_promoted_mode_t" >&6; } + +cat >>confdefs.h <<_ACEOF +#define PROMOTED_MODE_T $gl_cv_promoted_mode_t +_ACEOF + + + + + + GNULIB_FNMATCH=0; + HAVE_FNMATCH=1; + REPLACE_FNMATCH=0; + + + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_fnmatch_h='<'fnmatch.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_fnmatch_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_fnmatch_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'fnmatch.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_fnmatch_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_fnmatch_h + gl_cv_next_fnmatch_h='"'$gl_header'"' + else + gl_cv_next_fnmatch_h='<'fnmatch.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fnmatch_h" >&5 +$as_echo "$gl_cv_next_fnmatch_h" >&6; } + fi + NEXT_FNMATCH_H=$gl_cv_next_fnmatch_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'fnmatch.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_fnmatch_h + fi + NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H=$gl_next_as_first_directive + + + + + + + + if test $ac_cv_header_fnmatch_h = yes; then + HAVE_FNMATCH_H=1 + else + HAVE_FNMATCH_H=0 + fi + + + FNMATCH_H='' + if false; then + FNMATCH_H=fnmatch.h + else + if test $ac_cv_header_fnmatch_h != yes; then + FNMATCH_H=fnmatch.h + fi + fi + + + if test -n "$FNMATCH_H"; then + GL_GENERATE_FNMATCH_H_TRUE= + GL_GENERATE_FNMATCH_H_FALSE='#' +else + GL_GENERATE_FNMATCH_H_TRUE='#' + GL_GENERATE_FNMATCH_H_FALSE= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 @@ -11220,44 +11412,7 @@ fi - for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - eval ac_cv_have_decl_$gl_func=yes -fi - done @@ -11273,12 +11428,12 @@ if ${gl_cv_func_getcwd_null+:} false; then : else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_getcwd_null="guessing yes";; - # Guess yes on Cygwin. - cygwin*) gl_cv_func_getcwd_null="guessing yes";; - # If we don't know, assume the worst. - *) gl_cv_func_getcwd_null="guessing no";; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_getcwd_null="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_getcwd_null="guessing no";; esac else @@ -11299,7 +11454,7 @@ int main () { -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ /* mingw cwd does not start with '/', but getcwd does allocate. However, mingw fails to honor non-zero size. */ #else @@ -11806,7 +11961,7 @@ nocrash_init (void) } } } -#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#elif defined _WIN32 && ! defined __CYGWIN__ /* Avoid a crash on native Windows. */ #define WIN32_LEAN_AND_MEAN #include @@ -12032,8 +12187,6 @@ $as_echo "$gl_cv_func_getopt_long_gnu" >&6; } - - GNULIB_GETTIMEOFDAY=0; HAVE_GETTIMEOFDAY=1; HAVE_STRUCT_TIMEVAL=1; @@ -12234,48 +12387,7 @@ $as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; } fi - for gl_func in gettimeofday; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#if HAVE_SYS_TIME_H -# include -#endif -#include - -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - eval ac_cv_have_decl_$gl_func=yes -fi - done @@ -12314,341 +12426,6 @@ fi REPLACE_LOCALTIME=0; - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef _MSC_VER -MicrosoftCompiler -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "MicrosoftCompiler" >/dev/null 2>&1; then : - gl_asmext='asm' - gl_c_asm_opt='-c -Fa' - -else - gl_asmext='s' - gl_c_asm_opt='-S' - -fi -rm -f conftest* - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking host CPU and C ABI" >&5 -$as_echo_n "checking host CPU and C ABI... " >&6; } -if ${gl_cv_host_cpu_c_abi+:} false; then : - $as_echo_n "(cached) " >&6 -else - case "$host_cpu" in - - i[4567]86 ) - gl_cv_host_cpu_c_abi=i386 - ;; - - x86_64 ) - # On x86_64 systems, the C compiler may be generating code in one of - # these ABIs: - # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. - # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 - # with native Windows (mingw, MSVC). - # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. - # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if (defined __x86_64__ || defined __amd64__ \ - || defined _M_X64 || defined _M_AMD64) - int ok; - #else - error fail - #endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined __ILP32__ || defined _ILP32 - int ok; - #else - error fail - #endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_host_cpu_c_abi=x86_64-x32 -else - gl_cv_host_cpu_c_abi=x86_64 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - gl_cv_host_cpu_c_abi=i386 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ;; - - alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] ) - gl_cv_host_cpu_c_abi=alpha - ;; - - arm* | aarch64 ) - # Assume arm with EABI. - # On arm64 systems, the C compiler may be generating code in one of - # these ABIs: - # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. - # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. - # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __aarch64__ - int ok; - #else - error fail - #endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined __ILP32__ || defined _ILP32 - int ok; - #else - error fail - #endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_host_cpu_c_abi=arm64-ilp32 -else - gl_cv_host_cpu_c_abi=arm64 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - # Don't distinguish little-endian and big-endian arm, since they - # don't require different machine code for simple operations and - # since the user can distinguish them through the preprocessor - # defines __ARMEL__ vs. __ARMEB__. - # But distinguish arm which passes floating-point arguments and - # return values in integer registers (r0, r1, ...) - this is - # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which - # passes them in float registers (s0, s1, ...) and double registers - # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer - # sets the preprocessor defines __ARM_PCS (for the first case) and - # __ARM_PCS_VFP (for the second case), but older GCC does not. - echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c - # Look for a reference to the register d0 in the .s file. - { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } >/dev/null 2>&1 - if LC_ALL=C grep -E 'd0,' conftest.$gl_asmext >/dev/null; then - gl_cv_host_cpu_c_abi=armhf - else - gl_cv_host_cpu_c_abi=arm - fi - rm -f conftest* - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ;; - - hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) - # On hppa, the C compiler may be generating 32-bit code or 64-bit - # code. In the latter case, it defines _LP64 and __LP64__. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __LP64__ - int ok; - #else - error fail - #endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_host_cpu_c_abi=hppa64 -else - gl_cv_host_cpu_c_abi=hppa -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ;; - - ia64* ) - # On ia64 on HP-UX, the C compiler may be generating 64-bit code or - # 32-bit code. In the latter case, it defines _ILP32. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef _ILP32 - int ok; - #else - error fail - #endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_host_cpu_c_abi=ia64-ilp32 -else - gl_cv_host_cpu_c_abi=ia64 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ;; - - mips* ) - # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this - # at 32. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) - int ok; - #else - error fail - #endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_host_cpu_c_abi=mips64 -else - # In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but - # may later get defined by ), and _MIPS_SIM == _ABIN32. - # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but - # may later get defined by ), and _MIPS_SIM == _ABIO32. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if (_MIPS_SIM == _ABIN32) - int ok; - #else - error fail - #endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_host_cpu_c_abi=mipsn32 -else - gl_cv_host_cpu_c_abi=mips -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ;; - - powerpc* ) - # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. - # No need to distinguish them here; the caller may distinguish - # them based on the OS. - # On powerpc64 systems, the C compiler may still be generating - # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may - # be generating 64-bit code. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined __powerpc64__ || defined _ARCH_PPC64 - int ok; - #else - error fail - #endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # On powerpc64, there are two ABIs on Linux: The AIX compatible - # one and the ELFv2 one. The latter defines _CALL_ELF=2. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined _CALL_ELF && _CALL_ELF == 2 - int ok; - #else - error fail - #endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_host_cpu_c_abi=powerpc64-elfv2 -else - gl_cv_host_cpu_c_abi=powerpc64 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -else - gl_cv_host_cpu_c_abi=powerpc -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ;; - - rs6000 ) - gl_cv_host_cpu_c_abi=powerpc - ;; - - s390* ) - # On s390x, the C compiler may be generating 64-bit (= s390x) code - # or 31-bit (= s390) code. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined __LP64__ || defined __s390x__ - int ok; - #else - error fail - #endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_host_cpu_c_abi=s390x -else - gl_cv_host_cpu_c_abi=s390 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ;; - - sparc | sparc64 ) - # UltraSPARCs running Linux have `uname -m` = "sparc64", but the - # C compiler still generates 32-bit code. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined __sparcv9 || defined __arch64__ - int ok; - #else - error fail - #endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_host_cpu_c_abi=sparc64 -else - gl_cv_host_cpu_c_abi=sparc -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ;; - - *) - gl_cv_host_cpu_c_abi="$host_cpu" - ;; - esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi" >&5 -$as_echo "$gl_cv_host_cpu_c_abi" >&6; } - - HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'` - HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi" - - - - # This was - # AC_DEFINE_UNQUOTED([__${HOST_CPU}__]) - # AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__]) - # earlier, but KAI C++ 3.2d doesn't like this. - sed -e 's/-/_/g' >> confdefs.h <&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has ULLONG_WIDTH etc." >&5 -$as_echo_n "checking whether limits.h has ULLONG_WIDTH etc.... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc." >&5 +$as_echo_n "checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... " >&6; } if ${gl_cv_header_limits_width+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ - #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 - #endif - #include - int ullw = ULLONG_WIDTH; + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include + long long llm = LLONG_MAX; + int wb = WORD_BIT; + int ullw = ULLONG_WIDTH; + int main () { @@ -13844,7 +13624,9 @@ _ACEOF ;; esac - LIMITS_H=limits.h + + + LIMITS_H='limits.h' if test -n "$LIMITS_H"; then GL_GENERATE_LIMITS_H_TRUE= GL_GENERATE_LIMITS_H_FALSE='#' @@ -13858,6 +13640,7 @@ fi + if test -n "$STDINT_H"; then GL_GENERATE_STDINT_H_TRUE= GL_GENERATE_STDINT_H_FALSE='#' @@ -13878,6 +13661,7 @@ fi HAVE_DECL_IMAXDIV=1; HAVE_DECL_STRTOIMAX=1; HAVE_DECL_STRTOUMAX=1; + HAVE_IMAXDIV_T=1; REPLACE_STRTOIMAX=0; REPLACE_STRTOUMAX=0; INT32_MAX_LT_INTMAX_MAX=1; @@ -13974,44 +13758,7 @@ $as_echo "$gl_cv_next_inttypes_h" >&6; } - for gl_func in imaxabs imaxdiv strtoimax strtoumax; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - eval ac_cv_have_decl_$gl_func=yes -fi - done @@ -14409,55 +14156,7 @@ $as_echo "$gl_cv_type_wctrans_t" >&6; } fi - for gl_func in wctype iswctype wctrans towctrans ; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.0.1 has a bug: , and must be - included before . */ -#if !(defined __GLIBC__ && !defined __UCLIBC__) -# include -# include -# include -# include -#endif -#include - -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - - eval ac_cv_have_decl_$gl_func=yes -fi - done @@ -14527,50 +14226,18 @@ $as_echo "$gl_cv_macro_O_CLOEXEC" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library >= 2.1 or uClibc" >&5 -$as_echo_n "checking whether we are using the GNU C Library >= 2.1 or uClibc... " >&6; } -if ${ac_cv_gnu_library_2_1+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#ifdef __GNU_LIBRARY__ - #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) - Lucky GNU user - #endif -#endif -#ifdef __UCLIBC__ - Lucky user -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "Lucky" >/dev/null 2>&1; then : - ac_cv_gnu_library_2_1=yes -else - ac_cv_gnu_library_2_1=no -fi -rm -f conftest* - - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 -$as_echo "$ac_cv_gnu_library_2_1" >&6; } - - GLIBC21="$ac_cv_gnu_library_2_1" - - - GNULIB_LOCALECONV=0; GNULIB_SETLOCALE=0; GNULIB_DUPLOCALE=0; - HAVE_DUPLOCALE=1; + GNULIB_LOCALENAME=0; + HAVE_NEWLOCALE=1; + HAVE_DUPLOCALE=1; + HAVE_FREELOCALE=1; REPLACE_LOCALECONV=0; REPLACE_SETLOCALE=0; + REPLACE_NEWLOCALE=0; REPLACE_DUPLOCALE=0; + REPLACE_FREELOCALE=0; REPLACE_STRUCT_LCONV=0; @@ -14615,19 +14282,49 @@ $as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h STDDEF_H= - ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include -" -if test "x$ac_cv_type_max_align_t" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5 +$as_echo_n "checking for good max_align_t... " >&6; } +if ${gl_cv_type_max_align_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + unsigned int s = sizeof (max_align_t); + #if defined __GNUC__ || defined __IBM__ALIGNOF__ + int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1]; + int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1]; + #endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_type_max_align_t=yes else - HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h + gl_cv_type_max_align_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5 +$as_echo "$gl_cv_type_max_align_t" >&6; } + if test $gl_cv_type_max_align_t = no; then + HAVE_MAX_ALIGN_T=0 + STDDEF_H=stddef.h + fi if test $gt_cv_c_wchar_t = no; then HAVE_WCHAR_T=0 STDDEF_H=stddef.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 $as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; } if ${gl_cv_decl_null_works+:} false; then : @@ -14660,6 +14357,7 @@ $as_echo "$gl_cv_decl_null_works" >&6; } STDDEF_H=stddef.h fi + if test -n "$STDDEF_H"; then GL_GENERATE_STDDEF_H_TRUE= GL_GENERATE_STDDEF_H_FALSE='#' @@ -14759,7 +14457,7 @@ else int main () { -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ choke me #endif @@ -14800,7 +14498,7 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in # Guess yes on platforms where we know the result. - *-gnu* | freebsd* | netbsd* | openbsd* \ + *-gnu* | gnu* | freebsd* | netbsd* | openbsd* \ | hpux* | solaris* | cygwin* | mingw*) ac_cv_func_malloc_0_nonnull=yes ;; # If we don't know, assume the worst. @@ -14887,7 +14585,7 @@ int main () return 1; #else /* Check whether the given locale name is recognized by the system. */ -# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ +# if defined _WIN32 && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE @@ -15036,7 +14734,7 @@ int main () return 1; #else /* Check whether the given locale name is recognized by the system. */ -# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ +# if defined _WIN32 && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE @@ -15173,7 +14871,7 @@ int main () { variables, and all locales use the UTF-8 encoding. */ #if !(defined __BEOS__ || defined __HAIKU__) /* Check whether the given locale name is recognized by the system. */ -# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ +# if defined _WIN32 && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, not at the environment variables. Also, when an encoding suffix such as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE @@ -15618,8 +15316,6 @@ $as_echo "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time_t is signed" >&5 $as_echo_n "checking whether time_t is signed... " >&6; } if ${gl_cv_time_t_is_signed+:} false; then : @@ -16025,41 +15721,6 @@ $as_echo "#define HAVE_TM_GMTOFF 1" >>confdefs.h fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5 -$as_echo_n "checking for promoted mode_t type... " >&6; } -if ${gl_cv_promoted_mode_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1]; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_promoted_mode_t='int' -else - gl_cv_promoted_mode_t='mode_t' -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5 -$as_echo "$gl_cv_promoted_mode_t" >&6; } - -cat >>confdefs.h <<_ACEOF -#define PROMOTED_MODE_T $gl_cv_promoted_mode_t -_ACEOF - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : @@ -16184,7 +15845,7 @@ fi # parse-datetime.y works with bison only. - : ${YACC='bison -y'} + : ${YACC='bison -o y.tab.c'} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compound literals" >&5 @@ -16244,6 +15905,45 @@ $as_echo "#define HAVE_COMPOUND_LITERALS 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library >= 2.1 or uClibc" >&5 +$as_echo_n "checking whether we are using the GNU C Library >= 2.1 or uClibc... " >&6; } +if ${ac_cv_gnu_library_2_1+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif +#ifdef __UCLIBC__ + Lucky user +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Lucky" >/dev/null 2>&1; then : + ac_cv_gnu_library_2_1=yes +else + ac_cv_gnu_library_2_1=no +fi +rm -f conftest* + + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 +$as_echo "$ac_cv_gnu_library_2_1" >&6; } + + GLIBC21="$ac_cv_gnu_library_2_1" + + + + + @@ -16425,7 +16125,7 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in # Guess yes on glibc systems. - *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; + *-gnu* | gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; # Guess yes on FreeBSD >= 5. freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";; freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; @@ -16556,12 +16256,12 @@ if ${gl_cv_func_strerror_0_works+:} false; then : else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; - # Guess yes on native Windows. - mingw*) gl_cv_func_strerror_0_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_strerror_0_works="guessing no" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_strerror_0_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_strerror_0_works="guessing no" ;; esac else @@ -16685,44 +16385,7 @@ $as_echo "$gl_cv_next_string_h" >&6; } - for gl_func in ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r strsignal strverscmp; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - eval ac_cv_have_decl_$gl_func=yes -fi - done @@ -16816,48 +16479,7 @@ $as_echo "$gl_cv_next_strings_h" >&6; } - for gl_func in ffs strcasecmp strncasecmp; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - /* Minix 3.1.8 has a bug: must be included before - . */ - #include - #include - -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - eval ac_cv_have_decl_$gl_func=yes -fi - done ac_fn_c_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "$ac_includes_default" @@ -17922,7 +17544,7 @@ done if test $ac_cv_header_sys_acl_h = yes; then ac_save_LIBS=$LIBS - if test $use_acl = 0; then + if test $use_acl = 0; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing acl_get_file" >&5 $as_echo_n "checking for library containing acl_get_file... " >&6; } if ${ac_cv_search_acl_get_file+:} false; then : @@ -18765,8 +18387,8 @@ $as_echo "$gl_cv___builtin_expect" >&6; } HAVE_REALPATH=0 else case "$gl_cv_func_realpath_works" in - *yes) ;; - *) REPLACE_REALPATH=1 ;; + *yes) ;; + *) REPLACE_REALPATH=1 ;; esac fi else @@ -18870,7 +18492,7 @@ else # undef PATH_MAX # define PATH_MAX 1024 #endif -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ # undef PATH_MAX # define PATH_MAX 260 #endif @@ -19191,37 +18813,9 @@ $as_echo "#define GNULIB_TEST_CLOSEDIR 1" >>confdefs.h : - if test "x$datarootdir" = x; then - datarootdir='${datadir}' - - fi - if test "x$docdir" = x; then - docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' - - fi - if test "x$htmldir" = x; then - htmldir='${docdir}' - - fi - if test "x$dvidir" = x; then - dvidir='${docdir}' - - fi - if test "x$pdfdir" = x; then - pdfdir='${docdir}' - - fi - if test "x$psdir" = x; then - psdir='${docdir}' - - fi if test "x$lispdir" = x; then lispdir='${datarootdir}/emacs/site-lisp' - fi - if test "x$localedir" = x; then - localedir='${datarootdir}/locale' - fi if test "x$runstatedir" = x; then runstatedir='${localstatedir}/run' @@ -19385,44 +18979,7 @@ $as_echo "$gl_cv_next_dirent_h" >&6; } - for gl_func in alphasort closedir dirfd fdopendir opendir readdir rewinddir scandir; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - eval ac_cv_have_decl_$gl_func=yes -fi - done @@ -20081,10 +19638,10 @@ if ${ac_cv_func_getgroups_works+:} false; then : else if test "$cross_compiling" = yes; then : case "$host_os" in # (( - # Guess yes on glibc systems. - *-gnu*) ac_cv_func_getgroups_works="guessing yes" ;; - # If we don't know, assume the worst. - *) ac_cv_func_getgroups_works="guessing no" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) ac_cv_func_getgroups_works="guessing yes" ;; + # If we don't know, assume the worst. + *) ac_cv_func_getgroups_works="guessing no" ;; esac else @@ -20094,7 +19651,7 @@ $ac_includes_default int main () { -/* On Ultrix 4.3, getgroups (0, 0) always fails. */ +/* On NeXTstep 3.2, getgroups (0, 0) always fails. */ return getgroups (0, 0) == -1; ; return 0; @@ -20316,12 +19873,14 @@ if ${gl_cv_func_open_directory_works+:} false; then : else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_open_directory_works="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_open_directory_works="guessing no" ;; - # If we don't know, assume the worst. - *) gl_cv_func_open_directory_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_open_directory_works="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_open_directory_works="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_open_directory_works="guessing no" ;; esac else @@ -20868,44 +20427,17 @@ $as_echo "$gl_cv_next_fcntl_h" >&6; } - for gl_func in fcntl openat; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - eval ac_cv_have_decl_$gl_func=yes -fi - done + + + + + + +cat >>confdefs.h <<_ACEOF +#define GNULIB_FCNTL_SAFER 1 +_ACEOF @@ -21404,108 +20936,110 @@ fi - - FNMATCH_H= gl_fnmatch_required_lowercase=` echo $gl_fnmatch_required | LC_ALL=C tr '[A-Z]' '[a-z]' ` - gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5 + + if test $ac_cv_func_fnmatch = no; then + HAVE_FNMATCH=0 + else + gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working $gl_fnmatch_required fnmatch" >&5 $as_echo_n "checking for working $gl_fnmatch_required fnmatch... " >&6; } if eval \${$gl_fnmatch_cache_var+:} false; then : $as_echo_n "(cached) " >&6 else - if test $gl_fnmatch_required = GNU; then - gl_fnmatch_gnu_start= - gl_fnmatch_gnu_end= - else - gl_fnmatch_gnu_start='#if 0' - gl_fnmatch_gnu_end='#endif' - fi - if test "$cross_compiling" = yes; then : + if test $gl_fnmatch_required = GNU; then + gl_fnmatch_gnu_start= + gl_fnmatch_gnu_end= + else + gl_fnmatch_gnu_start='#if 0' + gl_fnmatch_gnu_end='#endif' + fi + if test "$cross_compiling" = yes; then : eval "$gl_fnmatch_cache_var=\"guessing no\"" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - static int - y (char const *pattern, char const *string, int flags) - { - return fnmatch (pattern, string, flags) == 0; - } - static int - n (char const *pattern, char const *string, int flags) - { - return fnmatch (pattern, string, flags) == FNM_NOMATCH; - } + static int + y (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == 0; + } + static int + n (char const *pattern, char const *string, int flags) + { + return fnmatch (pattern, string, flags) == FNM_NOMATCH; + } int main () { char const *Apat = 'A' < '\\\\' ? "[A-\\\\\\\\]" : "[\\\\\\\\-A]"; - char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; - static char const A_1[] = { 'A' - 1, 0 }; - static char const A01[] = { 'A' + 1, 0 }; - static char const a_1[] = { 'a' - 1, 0 }; - static char const a01[] = { 'a' + 1, 0 }; - static char const bs_1[] = { '\\\\' - 1, 0 }; - static char const bs01[] = { '\\\\' + 1, 0 }; - int result = 0; - if (!n ("a*", "", 0)) - return 1; - if (!y ("a*", "abc", 0)) - return 1; - if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */ - return 1; - if (!n ("d*/*1", "d/s/1", FNM_PATHNAME)) - return 2; - if (!y ("a\\\\bc", "abc", 0)) - return 3; - if (!n ("a\\\\bc", "abc", FNM_NOESCAPE)) - return 3; - if (!y ("*x", ".x", 0)) - return 4; - if (!n ("*x", ".x", FNM_PERIOD)) - return 4; - if (!y (Apat, "\\\\", 0)) - return 5; - if (!y (Apat, "A", 0)) - return 5; - if (!y (apat, "\\\\", 0)) - return 5; - if (!y (apat, "a", 0)) - return 5; - if (!(n (Apat, A_1, 0) == ('A' < '\\\\'))) - return 5; - if (!(n (apat, a_1, 0) == ('a' < '\\\\'))) - return 5; - if (!(y (Apat, A01, 0) == ('A' < '\\\\'))) - return 5; - if (!(y (apat, a01, 0) == ('a' < '\\\\'))) - return 5; - if (!(y (Apat, bs_1, 0) == ('A' < '\\\\'))) - return 5; - if (!(y (apat, bs_1, 0) == ('a' < '\\\\'))) - return 5; - if (!(n (Apat, bs01, 0) == ('A' < '\\\\'))) - return 5; - if (!(n (apat, bs01, 0) == ('a' < '\\\\'))) - return 5; - $gl_fnmatch_gnu_start - if (!y ("xxXX", "xXxX", FNM_CASEFOLD)) - result |= 8; - if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)) - result |= 16; - if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME)) - result |= 32; - if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)) - result |= 64; - if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)) - result |= 64; - if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)) - result |= 64; - $gl_fnmatch_gnu_end - return result; + char const *apat = 'a' < '\\\\' ? "[a-\\\\\\\\]" : "[\\\\\\\\-a]"; + static char const A_1[] = { 'A' - 1, 0 }; + static char const A01[] = { 'A' + 1, 0 }; + static char const a_1[] = { 'a' - 1, 0 }; + static char const a01[] = { 'a' + 1, 0 }; + static char const bs_1[] = { '\\\\' - 1, 0 }; + static char const bs01[] = { '\\\\' + 1, 0 }; + int result = 0; + if (!n ("a*", "", 0)) + return 1; + if (!y ("a*", "abc", 0)) + return 1; + if (!y ("[/b", "[/b", 0)) /*"]]"*/ /* glibc Bugzilla bug 12378 */ + return 1; + if (!n ("d*/*1", "d/s/1", FNM_PATHNAME)) + return 2; + if (!y ("a\\\\bc", "abc", 0)) + return 3; + if (!n ("a\\\\bc", "abc", FNM_NOESCAPE)) + return 3; + if (!y ("*x", ".x", 0)) + return 4; + if (!n ("*x", ".x", FNM_PERIOD)) + return 4; + if (!y (Apat, "\\\\", 0)) + return 5; + if (!y (Apat, "A", 0)) + return 5; + if (!y (apat, "\\\\", 0)) + return 5; + if (!y (apat, "a", 0)) + return 5; + if (!(n (Apat, A_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, a_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, A01, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, a01, 0) == ('a' < '\\\\'))) + return 5; + if (!(y (Apat, bs_1, 0) == ('A' < '\\\\'))) + return 5; + if (!(y (apat, bs_1, 0) == ('a' < '\\\\'))) + return 5; + if (!(n (Apat, bs01, 0) == ('A' < '\\\\'))) + return 5; + if (!(n (apat, bs01, 0) == ('a' < '\\\\'))) + return 5; + $gl_fnmatch_gnu_start + if (!y ("xxXX", "xXxX", FNM_CASEFOLD)) + result |= 8; + if (!y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)) + result |= 16; + if (!n ("d*/*1", "d/s/1", FNM_FILE_NAME)) + result |= 32; + if (!y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + if (!y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)) + result |= 64; + $gl_fnmatch_gnu_end + return result; ; return 0; @@ -21525,13 +21059,15 @@ fi eval ac_res=\$$gl_fnmatch_cache_var { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\"" - if test "$gl_fnmatch_result" = yes; then - rm -f "$gl_source_base/fnmatch.h" - else - FNMATCH_H=fnmatch.h + eval "gl_fnmatch_result=\"\$$gl_fnmatch_cache_var\"" + if test "$gl_fnmatch_result" != yes; then + REPLACE_FNMATCH=1 + fi fi + if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then + + FNMATCH_H='fnmatch.h' if test -n "$FNMATCH_H"; then GL_GENERATE_FNMATCH_H_TRUE= GL_GENERATE_FNMATCH_H_FALSE='#' @@ -21541,22 +21077,19 @@ else fi - if test -n "$FNMATCH_H"; then - + fi + if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then - gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" -cat >>confdefs.h <<_ACEOF -#define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch -_ACEOF ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include @@ -21580,22 +21113,32 @@ _ACEOF - if test -n "$FNMATCH_H"; then + GNULIB_FNMATCH=1 +$as_echo "#define GNULIB_TEST_FNMATCH 1" >>confdefs.h - gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" -cat >>confdefs.h <<_ACEOF -#define fnmatch ${gl_fnmatch_required_lowercase}_fnmatch -_ACEOF + + + if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fnmatch.$ac_objext" + ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include @@ -21616,6 +21159,14 @@ _ACEOF fi +cat >>confdefs.h <<_ACEOF +#define GNULIB_FNMATCH_GNU 1 +_ACEOF + + + + + fp_headers=' #include #if HAVE_STDIO_EXT_H @@ -21789,6 +21340,19 @@ _ACEOF fi done + if test $ac_cv_func__fseeki64 = yes; then + ac_fn_c_check_decl "$LINENO" "_fseeki64" "ac_cv_have_decl__fseeki64" "$ac_includes_default" +if test "x$ac_cv_have_decl__fseeki64" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL__FSEEKI64 $ac_have_decl +_ACEOF + + fi fi @@ -21811,8 +21375,8 @@ $as_echo "#define GNULIB_TEST_FSEEKO 1" >>confdefs.h case "$host_os" in - mingw*) - REPLACE_FSTAT=1 + mingw* | solaris*) + REPLACE_FSTAT=1 ;; esac @@ -21885,6 +21449,7 @@ $as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h + if test $ac_cv_func_fstatat = no; then HAVE_FSTATAT=0 else @@ -21929,15 +21494,20 @@ $as_echo "$gl_cv_func_fstatat_zero_flag" >&6; } case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in *yes+*yes) ;; - *) REPLACE_FSTATAT=1 - case $gl_cv_func_fstatat_zero_flag in - *yes) + *) REPLACE_FSTATAT=1 ;; + esac + + case $host_os in + solaris*) + REPLACE_FSTATAT=1 ;; + esac + + case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in + 1,*yes) $as_echo "#define HAVE_WORKING_FSTATAT_ZERO_FLAG 1" >>confdefs.h ;; - esac - ;; esac fi @@ -22086,10 +21656,22 @@ else # Arrange for deletion of the temporary directory this test creates. ac_clean_files="$ac_clean_files confdir3" if test "$cross_compiling" = yes; then : - case "$host_os" in - aix*) gl_cv_func_getcwd_path_max='no, it has the AIX bug';; - *) gl_cv_func_getcwd_path_max=no;; + # Cross-compilation guesses: + case "$host_os" in + aix*) # On AIX, it has the AIX bug. + gl_cv_func_getcwd_path_max='no, it has the AIX bug' ;; + gnu*) # On Hurd, it is 'yes'. + gl_cv_func_getcwd_path_max=yes ;; + linux* | kfreebsd*) + # On older Linux+glibc it's 'no, but it is partly working', + # on newer Linux+glibc it's 'yes'. + # On Linux+musl libc, it's 'no, but it is partly working'. + # On kFreeBSD+glibc, it's 'no, but it is partly working'. + gl_cv_func_getcwd_path_max='no, but it is partly working' ;; + *) # If we don't know, assume the worst. + gl_cv_func_getcwd_path_max=no ;; esac + else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -22123,7 +21705,7 @@ else # undef PATH_MAX # define PATH_MAX 1024 #endif -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ # undef PATH_MAX # define PATH_MAX 260 #endif @@ -22314,16 +21896,44 @@ $as_echo "$gl_cv_func_getcwd_path_max" >&6; } - for ac_func in getpagesize -do : - ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" -if test "x$ac_cv_func_getpagesize" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETPAGESIZE 1 + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5 +$as_echo_n "checking for getpagesize... " >&6; } +if ${gl_cv_func_getpagesize+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +return getpagesize(); + ; + return 0; +} + _ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_getpagesize=yes +else + gl_cv_func_getpagesize=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -done +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getpagesize" >&5 +$as_echo "$gl_cv_func_getpagesize" >&6; } + + if test $gl_cv_func_getpagesize = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_GETPAGESIZE 1 +_ACEOF + + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd aborts when 4k < cwd_length < 16k" >&5 $as_echo_n "checking whether getcwd aborts when 4k < cwd_length < 16k... " >&6; } @@ -22366,7 +21976,7 @@ else # undef PATH_MAX # define PATH_MAX 1024 #endif -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ # undef PATH_MAX # define PATH_MAX 260 #endif @@ -22894,10 +22504,10 @@ if ${ac_cv_func_getgroups_works+:} false; then : else if test "$cross_compiling" = yes; then : case "$host_os" in # (( - # Guess yes on glibc systems. - *-gnu*) ac_cv_func_getgroups_works="guessing yes" ;; - # If we don't know, assume the worst. - *) ac_cv_func_getgroups_works="guessing no" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) ac_cv_func_getgroups_works="guessing yes" ;; + # If we don't know, assume the worst. + *) ac_cv_func_getgroups_works="guessing no" ;; esac else @@ -22907,7 +22517,7 @@ $ac_includes_default int main () { -/* On Ultrix 4.3, getgroups (0, 0) always fails. */ +/* On NeXTstep 3.2, getgroups (0, 0) always fails. */ return getgroups (0, 0) == -1; ; return 0; @@ -22960,10 +22570,10 @@ if ${gl_cv_func_getgroups_works+:} false; then : else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_getgroups_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_getgroups_works="guessing no" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_getgroups_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_getgroups_works="guessing no" ;; esac else @@ -23220,18 +22830,37 @@ $as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h - for ac_func in getpagesize -do : - ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" -if test "x$ac_cv_func_getpagesize" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETPAGESIZE 1 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5 +$as_echo_n "checking for getpagesize... " >&6; } +if ${gl_cv_func_getpagesize+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +return getpagesize(); + ; + return 0; +} + _ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_getpagesize=yes +else + gl_cv_func_getpagesize=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -done +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getpagesize" >&5 +$as_echo "$gl_cv_func_getpagesize" >&6; } - if test $ac_cv_func_getpagesize = no; then + if test $gl_cv_func_getpagesize = no; then HAVE_GETPAGESIZE=0 for ac_header in OS.h do : @@ -23426,12 +23055,12 @@ else if test "$cross_compiling" = yes; then : # When cross-compiling: case "$host_os" in - # Guess all is fine on glibc systems. - *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_gettimeofday_clobber="guessing no" ;; - # If we don't know, assume the worst. - *) gl_cv_func_gettimeofday_clobber="guessing yes" ;; + # Guess all is fine on glibc systems. + *-gnu* | gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_gettimeofday_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_gettimeofday_clobber="guessing yes" ;; esac else @@ -23639,10 +23268,6 @@ $as_echo "#define GNULIB_TEST_GROUP_MEMBER 1" >>confdefs.h - : - - - : @@ -24063,12 +23688,13 @@ $as_echo "$gl_cv_next_langinfo_h" >&6; } HAVE_LANGINFO_CODESET=0 HAVE_LANGINFO_T_FMT_AMPM=0 + HAVE_LANGINFO_ALTMON=0 HAVE_LANGINFO_ERA=0 HAVE_LANGINFO_YESEXPR=0 if test $ac_cv_header_langinfo_h = yes; then HAVE_LANGINFO_H=1 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines CODESET" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines CODESET" >&5 $as_echo_n "checking whether langinfo.h defines CODESET... " >&6; } if ${gl_cv_header_langinfo_codeset+:} false; then : $as_echo_n "(cached) " >&6 @@ -24130,6 +23756,37 @@ $as_echo "$gl_cv_header_langinfo_t_fmt_ampm" >&6; } if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then HAVE_LANGINFO_T_FMT_AMPM=1 fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ALTMON_1" >&5 +$as_echo_n "checking whether langinfo.h defines ALTMON_1... " >&6; } +if ${gl_cv_header_langinfo_altmon+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = ALTMON_1; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_langinfo_altmon=yes +else + gl_cv_header_langinfo_altmon=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_altmon" >&5 +$as_echo "$gl_cv_header_langinfo_altmon" >&6; } + if test $gl_cv_header_langinfo_altmon = yes; then + HAVE_LANGINFO_ALTMON=1 + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ERA" >&5 $as_echo_n "checking whether langinfo.h defines ERA... " >&6; } if ${gl_cv_header_langinfo_era+:} false; then : @@ -24202,44 +23859,8 @@ $as_echo "$gl_cv_header_langinfo_yesexpr" >&6; } - for gl_func in nl_langinfo; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - eval ac_cv_have_decl_$gl_func=yes -fi - done @@ -24303,6 +23924,39 @@ $as_echo "#define GNULIB_TEST_LCHOWN 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the __inline keyword" >&5 +$as_echo_n "checking whether the compiler supports the __inline keyword... " >&6; } +if ${gl_cv_c___inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +typedef int foo_t; + static __inline foo_t foo (void) { return 0; } +int +main () +{ +return foo (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_c___inline=yes +else + gl_cv_c___inline=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c___inline" >&5 +$as_echo "$gl_cv_c___inline" >&6; } + if test $gl_cv_c___inline = yes; then + +$as_echo "#define HAVE___INLINE 1" >>confdefs.h + + fi + + @@ -24321,10 +23975,12 @@ else fi if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_link_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_link_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_link_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_link_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_link_works="guessing no" ;; esac else @@ -24444,10 +24100,10 @@ else echo > conftest.file if test "$cross_compiling" = yes; then : case "$host_os" in - # On glibc/Linux we know the result. - linux*-gnu*) gl_cv_func_link_follows_symlink="guessing no" ;; - # Otherwise, we don't know. - *) gl_cv_func_link_follows_symlink=unknown ;; + # On glibc/Linux we know the result. + linux*-gnu* | gnu*) gl_cv_func_link_follows_symlink="guessing no" ;; + # Otherwise, we don't know. + *) gl_cv_func_link_follows_symlink=unknown ;; esac else @@ -24582,10 +24238,14 @@ if ${gl_cv_func_linkat_slash+:} false; then : else rm -rf conftest.a conftest.b conftest.c conftest.d conftest.e conftest.s if test "$cross_compiling" = yes; then : - # Guess yes on glibc systems, no otherwise. + case "$host_os" in - *-gnu*) gl_cv_func_linkat_slash="guessing yes";; - *) gl_cv_func_linkat_slash="guessing no";; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_linkat_slash="guessing yes";; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_linkat_slash="guessing yes";; + # If we don't know, assume the worst. + *) gl_cv_func_linkat_slash="guessing no";; esac else @@ -24717,12 +24377,7 @@ $as_echo "#define GNULIB_TEST_LINKAT 1" >>confdefs.h - - - - - - LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" + LOCALCHARSET_TESTS_ENVIRONMENT= @@ -24915,48 +24570,7 @@ $as_echo "$gl_cv_next_locale_h" >&6; } - for gl_func in setlocale duplocale; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -/* Some systems provide declarations in a non-standard header. */ -#if HAVE_XLOCALE_H -# include -#endif - -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - eval ac_cv_have_decl_$gl_func=yes -fi - done @@ -25136,10 +24750,11 @@ $as_echo "#define GNULIB_TEST_LSEEK 1" >>confdefs.h + if test $ac_cv_func_lstat = yes; then - case "$gl_cv_func_lstat_dereferences_slashed_symlink" in - *no) + case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in + solaris* | *no) REPLACE_LSTAT=1 ;; esac @@ -25198,7 +24813,7 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in # Guess yes on platforms where we know the result. - *-gnu* | freebsd* | netbsd* | openbsd* \ + *-gnu* | gnu* | freebsd* | netbsd* | openbsd* \ | hpux* | solaris* | cygwin* | mingw*) ac_cv_func_malloc_0_nonnull=yes ;; # If we don't know, assume the worst. @@ -25852,12 +25467,11 @@ if ${gl_cv_func_mbrtowc_empty_input+:} false; then : else case "$host_os" in - # Guess no on AIX and glibc systems. - aix* | *-gnu*) - gl_cv_func_mbrtowc_empty_input="guessing no" ;; - # Guess yes on native Windows. - mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; - *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; + # Guess no on AIX and glibc systems. + aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; + *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; esac if test "$cross_compiling" = yes; then : : @@ -26010,6 +25624,7 @@ $as_echo "#define C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h gl_LIBOBJS="$gl_LIBOBJS mbrtowc.$ac_objext" + : fi @@ -26808,10 +26423,12 @@ else rm -rf conftest.dir if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; - # Guess yes on MSVC, no on mingw. - mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;; + # Guess yes on MSVC, no on mingw. + mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _MSC_VER @@ -26827,9 +26444,9 @@ else fi rm -f conftest* - ;; - # If we don't know, assume the worst. - *) gl_cv_func_mkdir_trailing_slash_works="guessing no" ;; + ;; + # If we don't know, assume the worst. + *) gl_cv_func_mkdir_trailing_slash_works="guessing no" ;; esac else @@ -26877,12 +26494,12 @@ else rm -rf conftest.dir if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;; - # If we don't know, assume the worst. - *) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_mkdir_trailing_dot_works="guessing no" ;; esac else @@ -27024,10 +26641,41 @@ $as_echo "#define GNULIB_TEST_MKDTEMP 1" >>confdefs.h - if test $ac_cv_func_mkfifo = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mkfifo" >&5 +$as_echo_n "checking for mkfifo... " >&6; } +if ${gl_cv_func_mkfifo+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +return mkfifo("/",0); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_mkfifo=yes +else + gl_cv_func_mkfifo=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkfifo" >&5 +$as_echo "$gl_cv_func_mkfifo" >&6; } + if test $gl_cv_func_mkfifo = no; then HAVE_MKFIFO=0 else +$as_echo "#define HAVE_MKFIFO 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkfifo rejects trailing slashes" >&5 $as_echo_n "checking whether mkfifo rejects trailing slashes... " >&6; } if ${gl_cv_func_mkfifo_works+:} false; then : @@ -27039,10 +26687,12 @@ else fi if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_mkfifo_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_mkfifo_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_mkfifo_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_mkfifo_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_mkfifo_works="guessing no" ;; esac else @@ -27197,10 +26847,12 @@ if ${gl_cv_func_mknod_works+:} false; then : else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_mknod_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_mknod_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_mknod_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_mknod_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_mknod_works="guessing no" ;; esac else @@ -27461,8 +27113,11 @@ cat >>confdefs.h <<_ACEOF #define FUNC_NL_LANGINFO_YESEXPR_WORKS $FUNC_NL_LANGINFO_YESEXPR_WORKS _ACEOF - if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \ - && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then + if test $HAVE_LANGINFO_CODESET = 1 \ + && test $HAVE_LANGINFO_T_FMT_AMPM = 1 \ + && test $HAVE_LANGINFO_ALTMON = 1 \ + && test $HAVE_LANGINFO_ERA = 1 \ + && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then : else REPLACE_NL_LANGINFO=1 @@ -27758,6 +27413,16 @@ $as_echo "#define GNULIB_TEST_OPENAT 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define GNULIB_OPENAT_SAFER 1 +_ACEOF + + + + + for ac_func in opendir do : ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir" @@ -28168,10 +27833,12 @@ else ln -s conftest.link conftest.lnk2 if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_readlink_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_readlink_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_readlink_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_readlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_readlink_works="guessing no" ;; esac else @@ -28576,6 +28243,17 @@ int result = 0; if (! REG_STARTEND) result |= 64; + /* Matching with the compiled form of this regexp would provoke + an assertion failure prior to glibc-2.28: + regexec.c:1375: pop_fail_stack: Assertion 'num >= 0' failed + With glibc-2.28, compilation fails and reports the invalid + back reference. */ + re_set_syntax (RE_SYNTAX_POSIX_EGREP); + memset (®ex, 0, sizeof regex); + s = re_compile_pattern ("0|()0|\\1|0", 10, ®ex); + if (!s || strcmp (s, "Invalid back reference")) + result |= 64; + #if 0 /* It would be nice to reject hosts whose regoff_t values are too narrow (including glibc on hosts with 64-bit ptrdiff_t and @@ -28734,12 +28412,14 @@ else fi if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;; - # If we don't know, assume the worst. - *) gl_cv_func_rename_slash_dst_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_rename_slash_dst_works="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_rename_slash_dst_works="guessing no" ;; esac else @@ -28805,12 +28485,14 @@ else fi if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;; - # Guess yes on native Windows. - mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_rename_slash_src_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_rename_slash_src_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_rename_slash_src_works="guessing no" ;; esac else @@ -28874,12 +28556,14 @@ else set x `ls -i conftest.f conftest.f1` && test "" = ""; then if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;; - # Guess yes on native Windows. - mingw*) gl_cv_func_rename_link_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_rename_link_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_rename_link_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_rename_link_works="guessing no" ;; esac else @@ -28957,12 +28641,14 @@ else as_fn_error $? "cannot create temporary files" "$LINENO" 5 if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_rename_dest_works="guessing no" ;; - # If we don't know, assume the worst. - *) gl_cv_func_rename_dest_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_rename_dest_works="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_rename_dest_works="guessing no" ;; esac else @@ -29193,12 +28879,14 @@ else touch conftest.file if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_rmdir_works="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_rmdir_works="guessing no" ;; - # If we don't know, assume the worst. - *) gl_cv_func_rmdir_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_rmdir_works="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_rmdir_works="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_rmdir_works="guessing no" ;; esac else @@ -29569,10 +29257,10 @@ if ${gl_cv_func_setenv_works+:} false; then : else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_setenv_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_setenv_works="guessing no" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_setenv_works="guessing no" ;; esac else @@ -29758,44 +29446,7 @@ fi - for gl_func in pthread_sigmask sigaction sigaddset sigdelset sigemptyset sigfillset sigismember sigpending sigprocmask; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - eval ac_cv_have_decl_$gl_func=yes -fi - done @@ -29918,12 +29569,12 @@ if ${gl_cv_func_sleep_works+:} false; then : else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_sleep_works="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_sleep_works="guessing no" ;; - # If we don't know, assume the worst. - *) gl_cv_func_sleep_works="guessing no" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_sleep_works="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_sleep_works="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_sleep_works="guessing no" ;; esac else @@ -30248,10 +29899,12 @@ else fi if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_stat_file_slash="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_stat_file_slash="guessing no" ;; esac else @@ -30296,6 +29949,10 @@ $as_echo "$gl_cv_func_stat_file_slash" >&6; } $as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h ;; esac + case $host_os in + solaris*) + REPLACE_FSTAT=1 ;; + esac ;; esac @@ -30565,11 +30222,10 @@ fi NEXT_STDARG_H='' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 $as_echo_n "checking for va_copy... " >&6; } - if ${gl_cv_func_va_copy+:} false; then : +if ${gl_cv_func_va_copy+:} false; then : $as_echo_n "(cached) " >&6 else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -30590,9 +30246,9 @@ else gl_cv_func_va_copy=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_va_copy" >&5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_va_copy" >&5 $as_echo "$gl_cv_func_va_copy" >&6; } if test $gl_cv_func_va_copy = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -30774,19 +30430,49 @@ fi STDDEF_H= - ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include -" -if test "x$ac_cv_type_max_align_t" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5 +$as_echo_n "checking for good max_align_t... " >&6; } +if ${gl_cv_type_max_align_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + unsigned int s = sizeof (max_align_t); + #if defined __GNUC__ || defined __IBM__ALIGNOF__ + int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1]; + int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1]; + #endif + +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_type_max_align_t=yes else - HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h + gl_cv_type_max_align_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5 +$as_echo "$gl_cv_type_max_align_t" >&6; } + if test $gl_cv_type_max_align_t = no; then + HAVE_MAX_ALIGN_T=0 + STDDEF_H=stddef.h + fi if test $gt_cv_c_wchar_t = no; then HAVE_WCHAR_T=0 STDDEF_H=stddef.h fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 $as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; } if ${gl_cv_decl_null_works+:} false; then : @@ -30819,6 +30505,7 @@ $as_echo "$gl_cv_decl_null_works" >&6; } STDDEF_H=stddef.h fi + if test -n "$STDDEF_H"; then GL_GENERATE_STDDEF_H_TRUE= GL_GENERATE_STDDEF_H_FALSE='#' @@ -30993,7 +30680,7 @@ else /* For non-mingw systems, compilation will trivially succeed. For mingw, compilation will succeed for older mingw (system printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */ - #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \ + #if (defined _WIN32 && ! defined __CYGWIN__) && \ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1]; #endif @@ -31058,44 +30745,7 @@ _ACEOF - for gl_func in dprintf fpurge fseeko ftello getdelim getline gets pclose popen renameat snprintf tmpfile vdprintf vsnprintf; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - - eval ac_cv_have_decl_$gl_func=yes -fi - done @@ -31173,50 +30823,7 @@ $as_echo "$gl_cv_next_stdlib_h" >&6; } - for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt ptsname ptsname_r qsort_r random random_r reallocarray realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#if HAVE_SYS_LOADAVG_H -# include -#endif -#if HAVE_RANDOM_H -# include -#endif - -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - eval ac_cv_have_decl_$gl_func=yes -fi - done @@ -31516,10 +31123,10 @@ if ${gl_cv_func_working_strerror+:} false; then : else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_working_strerror="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_working_strerror="guessing no" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_working_strerror="guessing no" ;; esac else @@ -32176,10 +31783,12 @@ if ${gl_cv_func_symlink_works+:} false; then : else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_symlink_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_symlink_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_symlink_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_symlink_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_symlink_works="guessing no" ;; esac else @@ -32266,10 +31875,12 @@ if ${gl_cv_func_symlinkat_works+:} false; then : else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_symlinkat_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_symlinkat_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_symlinkat_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_symlinkat_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_symlinkat_works="guessing no" ;; esac else @@ -32451,44 +32062,7 @@ fi - for gl_func in fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat mknod mknodat stat utimensat; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - - eval ac_cv_have_decl_$gl_func=yes -fi - done @@ -32743,6 +32317,60 @@ $as_echo "#define GNULIB_TEST_TIME_R 1" >>confdefs.h + # Mac OS X 10.6 loops forever with some time_t values. + # See Bug#27706, Bug#27736, and + # https://lists.gnu.org/r/bug-gnulib/2017-07/msg00142.html + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether localtime loops forever near extrema" >&5 +$as_echo_n "checking whether localtime loops forever near extrema... " >&6; } +if ${gl_cv_func_localtime_infloop_bug+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_func_localtime_infloop_bug=no + if test "$cross_compiling" = yes; then : + gl_cv_func_localtime_infloop_bug="guessing no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + #include + +int +main () +{ + + time_t t = -67768038400666600; + struct tm *tm; + char *tz = getenv ("TZ"); + if (! (tz && strcmp (tz, "QQQ0") == 0)) + return 0; + alarm (2); + tm = localtime (&t); + /* Use TM and *TM to suppress over-optimization. */ + return tm && tm->tm_isdst; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + (TZ=QQQ0 ./conftest$EXEEXT) >/dev/null 2>&1 || + gl_cv_func_localtime_infloop_bug=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_localtime_infloop_bug" >&5 +$as_echo "$gl_cv_func_localtime_infloop_bug" >&6; } + if test "$gl_cv_func_localtime_infloop_bug" = yes; then + +$as_echo "#define HAVE_LOCALTIME_INFLOOP_BUG 1" >>confdefs.h + + fi + ac_fn_c_check_type "$LINENO" "timezone_t" "ac_cv_type_timezone_t" "#include " if test "x$ac_cv_type_timezone_t" = xyes; then : @@ -32846,12 +32474,12 @@ if ${gl_cv_func_tzset_clobber+:} false; then : else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess all is fine on glibc systems. - *-gnu*) gl_cv_func_tzset_clobber="guessing no" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_tzset_clobber="guessing no" ;; - # If we don't know, assume the worst. - *) gl_cv_func_tzset_clobber="guessing yes" ;; + # Guess all is fine on glibc systems. + *-gnu* | gnu*) gl_cv_func_tzset_clobber="guessing no" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_tzset_clobber="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_tzset_clobber="guessing yes" ;; esac else @@ -33038,56 +32666,7 @@ $as_echo "$gl_cv_next_unistd_h" >&6; } - for gl_func in chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups gethostname getlogin getlogin_r getpagesize getusershell setusershell endusershell group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sethostname sleep symlink symlinkat truncate ttyname_r unlink unlinkat usleep; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if HAVE_UNISTD_H -# include -#endif -/* Some systems declare various items in the wrong headers. */ -#if !(defined __GLIBC__ && !defined __UCLIBC__) -# include -# include -# include -# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ -# include -# endif -#endif - -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - - eval ac_cv_have_decl_$gl_func=yes -fi - done @@ -33158,7 +32737,7 @@ fi || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ - && test $LIBUNISTRING_VERSION_SUBMINOR -lt 6 + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 8 } } } @@ -33193,12 +32772,14 @@ else fi if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_unlink_honors_slashes="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_unlink_honors_slashes="guessing no" ;; - # If we don't know, assume the worst. - *) gl_cv_func_unlink_honors_slashes="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_unlink_honors_slashes="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_unlink_honors_slashes="guessing yes" ;; + # Guess no on native Windows. + mingw*) gl_cv_func_unlink_honors_slashes="guessing no" ;; + # If we don't know, assume the worst. + *) gl_cv_func_unlink_honors_slashes="guessing no" ;; esac else @@ -33668,6 +33249,7 @@ $as_echo "#define GNULIB_TEST_UTIME 1" >>confdefs.h + if test $gl_cv_have_include_next = yes; then gl_cv_next_utime_h='<'utime.h'>' else @@ -33746,14 +33328,19 @@ $as_echo "$gl_cv_next_utime_h" >&6; } UTIME_H='' - if test $ac_cv_header_utime_h != yes; then - UTIME_H=utime.h - else - case "$host_os" in - mingw*) UTIME_H=utime.h - ;; - esac - fi + if false; then + UTIME_H=utime.h + else + if test $ac_cv_header_utime_h != yes; then + UTIME_H=utime.h + else + case "$host_os" in + mingw*) UTIME_H=utime.h + ;; + esac + fi + fi + if test -n "$UTIME_H"; then GL_GENERATE_UTIME_H_TRUE= @@ -33765,44 +33352,7 @@ fi - for gl_func in utime; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - eval ac_cv_have_decl_$gl_func=yes -fi - done @@ -33819,10 +33369,12 @@ else touch conftest.file if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_futimesat_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_futimesat_works="guessing no" ;; + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_futimesat_works="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_futimesat_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_futimesat_works="guessing no" ;; esac else @@ -34459,54 +34011,7 @@ $as_echo "$gl_cv_next_wchar_h" >&6; } - for gl_func in btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime ; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.0.1 has a bug: , and must be - included before . */ -#if !(defined __GLIBC__ && !defined __UCLIBC__) -# include -# include -# include -#endif -#include - -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - eval ac_cv_have_decl_$gl_func=yes -fi - done @@ -35120,55 +34625,7 @@ $as_echo "$gl_cv_type_wctrans_t" >&6; } fi - for gl_func in wctype iswctype wctrans towctrans ; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.0.1 has a bug: , and must be - included before . */ -#if !(defined __GLIBC__ && !defined __UCLIBC__) -# include -# include -# include -# include -#endif -#include - -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" -else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - - eval ac_cv_have_decl_$gl_func=yes -fi - done @@ -35248,9 +34705,9 @@ else if test "$cross_compiling" = yes; then : case "$host_os" in - # Guess yes on glibc and AIX 7 systems. - *-gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";; - *) gl_cv_func_wcwidth_works="guessing no";; + # Guess yes on glibc and AIX 7 systems. + *-gnu* | gnu* | aix[7-9]*) gl_cv_func_wcwidth_works="guessing yes";; + *) gl_cv_func_wcwidth_works="guessing no";; esac else @@ -35324,6 +34781,10 @@ $as_echo "$gl_cv_func_wcwidth_works" >&6; } gl_LIBOBJS="$gl_LIBOBJS wcwidth.$ac_objext" + + + : + fi @@ -35450,6 +34911,18 @@ done LIBGNU_LTLIBDEPS="$gl_ltlibdeps" + +if test $ac_cv_lib_error_at_line = no; then + # This means that the error() function is not present in libc, so + # the one from gnulib will be used instead. This function precedes + # error messages it prints with the program name as returned by getprogname() + # call, instead of using the name set by set_program_name. + # Install workaround. + +$as_echo "#define ENABLE_ERROR_PRINT_PROGNAME 1" >>confdefs.h + +fi + # paxutils modules @@ -35511,6 +34984,8 @@ fi + + # Set LIB_SETSOCKOPT to -lnsl -lsocket if necessary. pu_save_LIBS=$LIBS LIB_SETSOCKOPT= @@ -36069,13 +35544,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is supported" >&5 $as_echo_n "checking whether -Wno-missing-field-initializers is supported... " >&6; } - if ${gl_cv_cc_nomfi_supported+:} false; then : +if ${gl_cv_cc_nomfi_supported+:} false; then : $as_echo_n "(cached) " >&6 else - - gl_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -36092,29 +35566,28 @@ else gl_cv_cc_nomfi_supported=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$gl_save_CFLAGS" -fi + CFLAGS="$gl_save_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5 $as_echo "$gl_cv_cc_nomfi_supported" >&6; } if test "$gl_cv_cc_nomfi_supported" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is needed" >&5 $as_echo_n "checking whether -Wno-missing-field-initializers is needed... " >&6; } - if ${gl_cv_cc_nomfi_needed+:} false; then : +if ${gl_cv_cc_nomfi_needed+:} false; then : $as_echo_n "(cached) " >&6 else - - gl_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -W -Werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -W -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int f (void) - { - typedef struct { int a; int b; } s_t; - s_t s1 = { 0, }; - return s1.b; - } + { + typedef struct { int a; int b; } s_t; + s_t s1 = { 0, }; + return s1.b; + } int main () @@ -36130,23 +35603,21 @@ else gl_cv_cc_nomfi_needed=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$gl_save_CFLAGS" + CFLAGS="$gl_save_CFLAGS" fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5 $as_echo "$gl_cv_cc_nomfi_needed" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Wuninitialized is supported" >&5 $as_echo_n "checking whether -Wuninitialized is supported... " >&6; } - if ${gl_cv_cc_uninitialized_supported+:} false; then : +if ${gl_cv_cc_uninitialized_supported+:} false; then : $as_echo_n "(cached) " >&6 else - - gl_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Werror -Wuninitialized" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wuninitialized" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -36163,10 +35634,10 @@ else gl_cv_cc_uninitialized_supported=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$gl_save_CFLAGS" -fi + CFLAGS="$gl_save_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_uninitialized_supported" >&5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_uninitialized_supported" >&5 $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } fi @@ -36175,18 +35646,17 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } # To compare this list to your installed GCC's, run this Bash command: # # comm -3 \ - # <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \ - # <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort | - # grep -v -x -F -f <( - # awk '/^[^#]/ {print ws}' ../build-aux/gcc-warning.spec)) + # <((sed -n 's/^ *\(-[^ 0-9][^ ]*\) .*/\1/p' manywarnings.m4; \ + # awk '/^[^#]/ {print ws}' ../build-aux/gcc-warning.spec) | sort) \ + # <(LC_ALL=C gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort) gl_manywarn_set= for gl_manywarn_item in -fno-common \ -W \ - -Wabi \ -Waddress \ -Waggressive-loop-optimizations \ -Wall \ + -Wattribute-alias \ -Wattributes \ -Wbad-function-cast \ -Wbool-compare \ @@ -36194,8 +35664,9 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } -Wbuiltin-declaration-mismatch \ -Wbuiltin-macro-redefined \ -Wcast-align \ + -Wcast-align=strict \ + -Wcast-function-type \ -Wchar-subscripts \ - -Wchkp \ -Wclobbered \ -Wcomment \ -Wcomments \ @@ -36229,6 +35700,7 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } -Wframe-address \ -Wfree-nonheap-object \ -Whsa \ + -Wif-not-aligned \ -Wignored-attributes \ -Wignored-qualifiers \ -Wimplicit \ @@ -36242,7 +35714,6 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } -Wint-to-pointer-cast \ -Winvalid-memory-model \ -Winvalid-pch \ - -Wjump-misses-init \ -Wlogical-not-parentheses \ -Wlogical-op \ -Wmain \ @@ -36250,6 +35721,7 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } -Wmemset-elt-size \ -Wmemset-transposed-args \ -Wmisleading-indentation \ + -Wmissing-attributes \ -Wmissing-braces \ -Wmissing-declarations \ -Wmissing-field-initializers \ @@ -36257,6 +35729,7 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } -Wmissing-parameter-type \ -Wmissing-prototypes \ -Wmultichar \ + -Wmultistatement-macros \ -Wnarrowing \ -Wnested-externs \ -Wnonnull \ @@ -36271,6 +35744,7 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } -Woverride-init \ -Wpacked \ -Wpacked-bitfield-compat \ + -Wpacked-not-aligned \ -Wparentheses \ -Wpointer-arith \ -Wpointer-compare \ @@ -36288,20 +35762,23 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; } -Wshift-count-overflow \ -Wshift-negative-value \ -Wsizeof-array-argument \ + -Wsizeof-pointer-div \ -Wsizeof-pointer-memaccess \ -Wstack-protector \ -Wstrict-aliasing \ -Wstrict-overflow \ -Wstrict-prototypes \ + -Wstringop-truncation \ + -Wsuggest-attribute=cold \ -Wsuggest-attribute=const \ -Wsuggest-attribute=format \ + -Wsuggest-attribute=malloc \ -Wsuggest-attribute=noreturn \ -Wsuggest-attribute=pure \ -Wsuggest-final-methods \ -Wsuggest-final-types \ -Wswitch \ -Wswitch-bool \ - -Wswitch-default \ -Wswitch-unreachable \ -Wsync-nand \ -Wsystem-headers \ @@ -37139,6 +36616,22 @@ cat >>confdefs.h <<_ACEOF _ACEOF + + + +# Check whether --with-zstd was given. +if test "${with_zstd+set}" = set; then : + withval=$with_zstd; tar_cv_compressor_zstd=${withval} +else + tar_cv_compressor_zstd=zstd +fi + + +cat >>confdefs.h <<_ACEOF +#define ZSTD_PROGRAM "$tar_cv_compressor_zstd" +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for default archive format" >&5 $as_echo_n "checking for default archive format... " >&6; } @@ -37468,17 +36961,243 @@ fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5 -$as_echo_n "checking for the common suffixes of directories in the library search path... " >&6; } -if ${acl_cv_libdirstems+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking 32-bit host C ABI" >&5 +$as_echo_n "checking 32-bit host C ABI... " >&6; } +if ${gl_cv_host_cpu_c_abi_32bit+:} false; then : $as_echo_n "(cached) " >&6 else - acl_libdirstem=lib - acl_libdirstem2= - case "$host_os" in - solaris*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 + if test -n "$gl_cv_host_cpu_c_abi"; then + case "$gl_cv_host_cpu_c_abi" in + i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) + gl_cv_host_cpu_c_abi_32bit=yes ;; + *) + gl_cv_host_cpu_c_abi_32bit=no ;; + esac + else + case "$host_cpu" in + + i[4567]86 ) + gl_cv_host_cpu_c_abi_32bit=yes + ;; + + x86_64 ) + # On x86_64 systems, the C compiler may be generating code in one of + # these ABIs: + # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. + # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 + # with native Windows (mingw, MSVC). + # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if (defined __x86_64__ || defined __amd64__ \ + || defined _M_X64 || defined _M_AMD64) \ + && !(defined __ILP32__ || defined _ILP32) + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=no +else + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + arm* | aarch64 ) + # Assume arm with EABI. + # On arm64 systems, the C compiler may be generating code in one of + # these ABIs: + # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. + # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32) + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=no +else + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) + # On hppa, the C compiler may be generating 32-bit code or 64-bit + # code. In the latter case, it defines _LP64 and __LP64__. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __LP64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=no +else + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + ia64* ) + # On ia64 on HP-UX, the C compiler may be generating 64-bit code or + # 32-bit code. In the latter case, it defines _ILP32. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef _ILP32 + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=yes +else + gl_cv_host_cpu_c_abi_32bit=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + mips* ) + # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this + # at 32. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=no +else + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + powerpc* ) + # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. + # No need to distinguish them here; the caller may distinguish + # them based on the OS. + # On powerpc64 systems, the C compiler may still be generating + # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may + # be generating 64-bit code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __powerpc64__ || defined _ARCH_PPC64 + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=no +else + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + rs6000 ) + gl_cv_host_cpu_c_abi_32bit=yes + ;; + + riscv32 | riscv64 ) + # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. + # Size of 'long' and 'void *': + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=no +else + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + s390* ) + # On s390x, the C compiler may be generating 64-bit (= s390x) code + # or 31-bit (= s390) code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __s390x__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=no +else + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + sparc | sparc64 ) + # UltraSPARCs running Linux have `uname -m` = "sparc64", but the + # C compiler still generates 32-bit code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __sparcv9 || defined __arch64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=no +else + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + *) + gl_cv_host_cpu_c_abi_32bit=no + ;; + esac + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi_32bit" >&5 +$as_echo "$gl_cv_host_cpu_c_abi_32bit" >&6; } + + HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit" + + + + + + case "$host_os" in + solaris*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 $as_echo_n "checking for 64-bit host... " >&6; } if ${gl_cv_solaris_64bit+:} false; then : $as_echo_n "(cached) " >&6 @@ -37486,10 +37205,10 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _LP64 - int ok; - #else - error fail - #endif + int ok; + #else + error fail + #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : @@ -37501,8 +37220,19 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 -$as_echo "$gl_cv_solaris_64bit" >&6; } - if test $gl_cv_solaris_64bit = yes; then +$as_echo "$gl_cv_solaris_64bit" >&6; };; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5 +$as_echo_n "checking for the common suffixes of directories in the library search path... " >&6; } +if ${acl_cv_libdirstems+:} false; then : + $as_echo_n "(cached) " >&6 +else + acl_libdirstem=lib + acl_libdirstem2= + case "$host_os" in + solaris*) + if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; @@ -37511,37 +37241,33 @@ $as_echo "$gl_cv_solaris_64bit" >&6; } fi ;; *) - case "$gl_cv_host_cpu_c_abi" in - i386 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | s390 | sparc) - ;; - *) # x86_64 | arm64 | hppa64 | ia64 | mips64 | powerpc64* | s390x | sparc64 | ... - searchpath=`(if test -f /usr/bin/gcc \ - && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \ - LC_ALL=C /usr/bin/gcc -print-search-dirs; \ - else \ - LC_ALL=C $CC -print-search-dirs; \ - fi) 2>/dev/null \ - | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` - if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" - for searchdir in $searchpath; do - if test -d "$searchdir"; then - case "$searchdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - */../ | */.. ) - # Better ignore directories of this form. They are misleading. - ;; - *) searchdir=`cd "$searchdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac ;; - esac - fi - done - IFS="$acl_save_IFS" - fi - ;; - esac + if test "$HOST_CPU_C_ABI_32BIT" != yes; then + searchpath=`(if test -f /usr/bin/gcc \ + && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \ + LC_ALL=C /usr/bin/gcc -print-search-dirs; \ + else \ + LC_ALL=C $CC -print-search-dirs; \ + fi) 2>/dev/null \ + | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + fi + fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" @@ -37564,7 +37290,6 @@ $as_echo "$acl_cv_libdirstems" >&6; } - use_additional=yes acl_save_prefix="$prefix" @@ -37602,7 +37327,7 @@ if test "${with_libiconv_prefix+set}" = set; then : additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then + && test ! -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi @@ -38024,7 +37749,6 @@ fi - am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do @@ -38730,9 +38454,6 @@ $as_echo "no" >&6; } fi - test -n "$localedir" || localedir='${datadir}/locale' - - test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= @@ -38830,9 +38551,45 @@ $as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } $as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyPreferredLanguages" >&5 +$as_echo_n "checking for CFLocaleCopyPreferredLanguages... " >&6; } +if ${gt_cv_func_CFLocaleCopyPreferredLanguages+:} false; then : + $as_echo_n "(cached) " >&6 +else + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +CFLocaleCopyPreferredLanguages(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_CFLocaleCopyPreferredLanguages=yes +else + gt_cv_func_CFLocaleCopyPreferredLanguages=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyPreferredLanguages" >&5 +$as_echo "$gt_cv_func_CFLocaleCopyPreferredLanguages" >&6; } + if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then + +$as_echo "#define HAVE_CFLOCALECOPYPREFERREDLANGUAGES 1" >>confdefs.h + fi INTL_MACOSX_LIBS= - if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + if test $gt_cv_func_CFPreferencesCopyAppValue = yes \ + || test $gt_cv_func_CFLocaleCopyCurrent = yes \ + || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi @@ -39193,7 +38950,6 @@ $as_echo "$LIBICONV" >&6; } - use_additional=yes acl_save_prefix="$prefix" @@ -39231,7 +38987,7 @@ if test "${with_libintl_prefix+set}" = set; then : additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then + && test ! -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi @@ -39647,7 +39403,6 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 $as_echo_n "checking for GNU gettext in libintl... " >&6; } if eval \${$gt_func_gnugettext_libintl+:} false; then : @@ -40028,6 +39783,10 @@ if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_F as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${GL_GENERATE_FNMATCH_H_TRUE}" && test -z "${GL_GENERATE_FNMATCH_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_FNMATCH_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -40522,7 +40281,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by GNU tar $as_me 1.30, which was +This file was extended by GNU tar $as_me 1.32, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -40590,7 +40349,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -GNU tar config.status 1.30 +GNU tar config.status 1.32 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -40711,9 +40470,8 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # Capture the value of obsolete ALL_LINGUAS because we need it to compute - # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it - # from automake < 1.5. - eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. + OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS" # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" @@ -41466,14 +41224,11 @@ $as_echo X"$file" | if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi - ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assignment from automake < 1.5. - eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. - # Hide the ALL_LINGUAS assignment from automake < 1.5. - eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) diff --git a/configure.ac b/configure.ac index 0bddbeb6ff0929b3e2714a79b3c1501e02f14eb0..75fb2e4fb4e4d350e4523081832d9f4f67de2203 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # Configure template for GNU tar. -*- autoconf -*- -# Copyright 1991, 1994-2010, 2013-2017 Free Software Foundation, Inc. +# Copyright 1991, 1994-2010, 2013-2019 Free Software Foundation, Inc. # This file is part of GNU tar. @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -AC_INIT([GNU tar], [1.30], [bug-tar@gnu.org]) +AC_INIT([GNU tar], [1.32], [bug-tar@gnu.org]) AC_CONFIG_SRCDIR([src/tar.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([config.h]) @@ -102,6 +102,18 @@ gt_TYPE_SSIZE_T # gnulib modules gl_INIT + +if test $ac_cv_lib_error_at_line = no; then + # This means that the error() function is not present in libc, so + # the one from gnulib will be used instead. This function precedes + # error messages it prints with the program name as returned by getprogname() + # call, instead of using the name set by set_program_name. + # Install workaround. + AC_DEFINE([ENABLE_ERROR_PRINT_PROGNAME],[1], + [Enable the use of error_print_progname to print program name with error messages. + See comment to function tar_print_progname in src/tar.c]) +fi + # paxutils modules tar_PAXUTILS @@ -250,6 +262,7 @@ TAR_COMPR_PROGRAM(lzip) TAR_COMPR_PROGRAM(lzma) TAR_COMPR_PROGRAM(lzop) TAR_COMPR_PROGRAM(xz) +TAR_COMPR_PROGRAM(zstd) AC_MSG_CHECKING(for default archive format) diff --git a/doc/Makefile.am b/doc/Makefile.am index cb69b743b86df53695a6582fdc11bb4431e3946e..7ac6808166a36a64b0bbc4e8545c8cd83927cabf 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,7 +1,6 @@ # Makefile for GNU tar documentation. -# Copyright 1994-1997, 1999-2001, 2003, 2006-2007, 2013-2014, 2016-2017 -# Free Software Foundation, Inc. +# Copyright 1994-2019 Free Software Foundation, Inc. # This file is part of GNU tar. diff --git a/doc/Makefile.in b/doc/Makefile.in index b30772eaad1dcfe1a16e76d3cf3ed610ec2b712d..572d5c70ef3fc0aa54cf94d1fb0376931c265f2d 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -16,8 +16,7 @@ # Makefile for GNU tar documentation. -# Copyright 1994-1997, 1999-2001, 2003, 2006-2007, 2013-2014, 2016-2017 -# Free Software Foundation, Inc. +# Copyright 1994-2019 Free Software Foundation, Inc. # This file is part of GNU tar. @@ -34,7 +33,17 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -97,15 +106,11 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(tar_TEXINFOS) $(top_srcdir)/build-aux/mdate-sh \ - $(srcdir)/version.texi $(srcdir)/stamp-vti \ - $(top_srcdir)/build-aux/texinfo.tex $(dist_man_MANS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/__inline.m4 \ $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/acl.m4 \ $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/argp.m4 \ - $(top_srcdir)/m4/asm-underscore.m4 \ $(top_srcdir)/m4/backupfile.m4 $(top_srcdir)/m4/bison.m4 \ $(top_srcdir)/m4/btowc.m4 $(top_srcdir)/m4/builtin-expect.m4 \ $(top_srcdir)/m4/canonicalize.m4 \ @@ -125,11 +130,12 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/extern-inline.m4 \ $(top_srcdir)/m4/faccessat.m4 $(top_srcdir)/m4/fchdir.m4 \ $(top_srcdir)/m4/fchmodat.m4 $(top_srcdir)/m4/fchownat.m4 \ - $(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/fcntl.m4 \ - $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fdopendir.m4 \ - $(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/filenamecat.m4 \ - $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \ - $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpending.m4 \ + $(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/fcntl-safer.m4 \ + $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fdopendir.m4 $(top_srcdir)/m4/fileblocks.m4 \ + $(top_srcdir)/m4/filenamecat.m4 $(top_srcdir)/m4/flexmember.m4 \ + $(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fnmatch.m4 \ + $(top_srcdir)/m4/fnmatch_h.m4 $(top_srcdir)/m4/fpending.m4 \ $(top_srcdir)/m4/fseek.m4 $(top_srcdir)/m4/fseeko.m4 \ $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/fstatat.m4 \ $(top_srcdir)/m4/futimens.m4 \ @@ -143,7 +149,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ $(top_srcdir)/m4/group-member.m4 \ - $(top_srcdir)/m4/hard-locale.m4 \ $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/human.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/include_next.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \ @@ -238,6 +243,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/version.texi \ + $(srcdir)/stamp-vti $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -335,6 +342,9 @@ man8dir = $(mandir)/man8 NROFF = nroff MANS = $(dist_man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \ + $(tar_TEXINFOS) $(top_srcdir)/build-aux/mdate-sh \ + $(top_srcdir)/build-aux/texinfo.tex DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkglibexecdir = @pkglibexecdir@ ACLOCAL = @ACLOCAL@ @@ -426,6 +436,7 @@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ GNULIB_FGETC = @GNULIB_FGETC@ GNULIB_FGETS = @GNULIB_FGETS@ +GNULIB_FNMATCH = @GNULIB_FNMATCH@ GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ @@ -458,6 +469,7 @@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPASS = @GNULIB_GETPASS@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ @@ -474,6 +486,7 @@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ +GNULIB_LOCALENAME = @GNULIB_LOCALENAME@ GNULIB_LOCALTIME = @GNULIB_LOCALTIME@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_LSTAT = @GNULIB_LSTAT@ @@ -712,6 +725,7 @@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ @@ -735,6 +749,9 @@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFS = @HAVE_FFS@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ +HAVE_FNMATCH = @HAVE_FNMATCH@ +HAVE_FNMATCH_H = @HAVE_FNMATCH_H@ +HAVE_FREELOCALE = @HAVE_FREELOCALE@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSTATAT = @HAVE_FSTATAT@ HAVE_FSYNC = @HAVE_FSYNC@ @@ -747,13 +764,16 @@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETPASS = @HAVE_GETPASS@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@ HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ @@ -786,6 +806,7 @@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_NEWLOCALE = @HAVE_NEWLOCALE@ HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OPENDIR = @HAVE_OPENDIR@ @@ -856,7 +877,6 @@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ -HAVE_TRUNCATE = @HAVE_TRUNCATE@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_TZSET = @HAVE_TZSET@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ @@ -911,8 +931,6 @@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ -HOST_CPU = @HOST_CPU@ -HOST_CPU_C_ABI = @HOST_CPU_C_ABI@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL = @INSTALL@ @@ -957,6 +975,7 @@ NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ +NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H = @NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ @@ -984,6 +1003,7 @@ NEXT_DIRENT_H = @NEXT_DIRENT_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_FNMATCH_H = @NEXT_FNMATCH_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ @@ -1044,9 +1064,11 @@ REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FNMATCH = @REPLACE_FNMATCH@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREELOCALE = @REPLACE_FREELOCALE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ @@ -1064,6 +1086,7 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETPASS = @REPLACE_GETPASS@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_GMTIME = @REPLACE_GMTIME@ REPLACE_ISATTY = @REPLACE_ISATTY@ @@ -1094,6 +1117,7 @@ REPLACE_MKNOD = @REPLACE_MKNOD@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ @@ -1315,7 +1339,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnits doc/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -1388,15 +1411,16 @@ $(srcdir)/stamp-vti: tar.texi $(top_srcdir)/configure echo "@set UPDATED $$1 $$2 $$3"; \ echo "@set UPDATED-MONTH $$2 $$3"; \ echo "@set EDITION $(VERSION)"; \ - echo "@set VERSION $(VERSION)") > vti.tmp - @cmp -s vti.tmp $(srcdir)/version.texi \ - || (echo "Updating $(srcdir)/version.texi"; \ - cp vti.tmp $(srcdir)/version.texi) - -@rm -f vti.tmp + echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \ + (cmp -s vti.tmp$$$$ $(srcdir)/version.texi \ + || (echo "Updating $(srcdir)/version.texi" && \ + cp vti.tmp$$$$ $(srcdir)/version.texi.tmp$$$$ && \ + mv $(srcdir)/version.texi.tmp$$$$ $(srcdir)/version.texi)) && \ + rm -f vti.tmp$$$$ $(srcdir)/version.texi.$$$$ @cp $(srcdir)/version.texi $@ mostlyclean-vti: - -rm -f vti.tmp + -rm -f vti.tmp* $(srcdir)/version.texi.tmp* maintainer-clean-vti: -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi @@ -1835,6 +1859,8 @@ uninstall-man: uninstall-man1 uninstall-man8 uninstall-html-am uninstall-info-am uninstall-man \ uninstall-man1 uninstall-man8 uninstall-pdf-am uninstall-ps-am +.PRECIOUS: Makefile + header.texi: $(top_srcdir)/src/tar.h sed -f $(srcdir)/texify.sed $(top_srcdir)/src/tar.h \ diff --git a/doc/dumpdir.texi b/doc/dumpdir.texi index 7000e9b162e14561779a8bfac9fbfdf64b5f6dc6..4a57817588648c194e81d62e08d6f91475ef3120 100644 --- a/doc/dumpdir.texi +++ b/doc/dumpdir.texi @@ -1,6 +1,5 @@ @c This is part of the paxutils manual. -@c Copyright (C) 2006-2007, 2014, 2016-2017 Free Software Foundation, -@c Inc. +@c Copyright (C) 2006-2019 Free Software Foundation, Inc. @c Written by Sergey Poznyakoff @c This file is distributed under GFDL 1.1 or any later version @c published by the Free Software Foundation. diff --git a/doc/fdl.texi b/doc/fdl.texi index e89851d5076cd0ab7edccf947833a5be1b5a025c..d1b4b8b358155da8214516a6c7e68935b87dcadd 100644 --- a/doc/fdl.texi +++ b/doc/fdl.texi @@ -5,8 +5,7 @@ @c hence no sectioning command or @node. @display -Copyright @copyright{} 2000-2002, 2007-2008, 2014, 2016-2017 Free -Software Foundation, Inc. +Copyright @copyright{} 2000-2019 Free Software Foundation, Inc. @uref{http://fsf.org/} Everyone is permitted to copy and distribute verbatim copies diff --git a/doc/gendocs_template b/doc/gendocs_template index 7600a89e41eca48720caf9212d06ddeefbcb75a4..55e9b3e2a92cf34c97136c4be878406b42c15703 100755 --- a/doc/gendocs_template +++ b/doc/gendocs_template @@ -106,7 +106,7 @@ Please send broken links and other corrections (or suggestions) to

-Copyright 2004, 2013-2014, 2016-2017 Free Software Foundation, Inc., +Copyright 2004-2019 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA
Verbatim copying and distribution of this entire article is diff --git a/doc/genfile.texi b/doc/genfile.texi index 58aa593a91a521de643e3356a9a42be1da49c58c..f65ecc386f68467ae2d40f95c98bdf4a490d7248 100644 --- a/doc/genfile.texi +++ b/doc/genfile.texi @@ -1,5 +1,5 @@ @c This is part of the paxutils manual. -@c Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +@c Copyright (C) 2005, 2006, 2009, 2108 Free Software Foundation, Inc. @c Written by Sergey Poznyakoff @c This file is distributed under GFDL 1.1 or any later version @c published by the Free Software Foundation. @@ -283,13 +283,43 @@ genfile --stat=name,atime * @cindex Exec Mode, @command{genfile} This mode is designed for testing the behavior of @code{paxutils} -commands when some of the files change during archiving. It is an -experimental mode. - - The @samp{Exec Mode} is toggled by @option{--run} command line -option (or its alias @option{-r}). The non-optional arguments to -@command{getopt} give the command line to be executed. Normally, -it should contain at least the @option{--checkpoint} option. +commands when some of the files change during archiving. It supposes +that the command being executed supports @option{--checkpoint} and +@option{--checkpoint-action} options (@pxref{checkpoints, +Checkpoints,,tar,GNU tar}). + + The @samp{Exec Mode} is enabled by @option{--run} command line +option (or its alias @option{-r}). The non-optional arguments +supply the command line to be executed. @command{Genfile} modifies +this command line by inserting the following options between the +command name and first argument: + +@example +--checkpoint=@var{n} +--checkpoint-action "echo=genfile checkpoint %u" +--checkpoint-action "wait=SIGUSR1" +@end example + + Here, @var{n} stands for the checkpoint granularity (for GNU +@command{tar}, it is the number of archive records read or written +between each pair of checkpoints). The default value is 1. This +value can be changed using the optional argument to the @option{--run} +option. For example, to run actions on each 10th checkpoint: + +@example +genfile --run=10 ... +@end example + + If the command line contains options, it must be preceded by a +double-dash (@samp{--}), which will prevent these options from being +interpreted by @command{genfile} itself. For example: + +@example +genfile --run --checkpoint=2 --truncate foo -- tar -c -f a.tar . +@end example + + Notice also, that when running @command{tar}, its command line may +not contain traditional options (cluster of letters without dash). A set of options is provided for defining checkpoint values and actions to be executed upon reaching them. Checkpoint values are @@ -334,36 +364,6 @@ connected to descriptor 1. All messages it prints to file descriptor 2, except checkpoint notifications, are forwarded to standard error. - @command{Genfile} exits with the exit status of the executed command. - - For compatibility with previous @command{genfile} versions, the -@option{--run} option takes an optional argument. If used this way, -its argument supplies the command line to be executed. There should -be no non-optional arguments in the @command{genfile} command line. - - The actual command line is constructed by inserting -the @option{--checkpoint} option between the command name and its -first argument (if any). Due to this, the argument to @option{--run} -may not use traditional @command{tar} option syntax, i.e., the -following is wrong: - -@smallexample -# Wrong! -genfile --run='tar cf foo bar' -@end smallexample - -@noindent - -Use the following syntax instead: - -@smallexample -genfile --run='tar -cf foo bar' @var{actions}... -@end smallexample - -The above command line is equivalent to - -@smallexample -genfile @var{actions}... -- tar -cf foo bar -@end smallexample + In exec mode, @command{genfile} exits with the exit status of the +executed command. -Notice, that the use of compatibility mode is deprecated. diff --git a/doc/header.texi b/doc/header.texi index 7c303d5f40859be17022f75cfea867f884e4fa3e..a4c433f81f578859ec5a97af0a9843faadbe637f 100644 --- a/doc/header.texi +++ b/doc/header.texi @@ -1,7 +1,6 @@ @comment GNU tar Archive Format description. @comment -@comment Copyright 1988-1989, 1991-1997, 2000-2001, 2003-2007, 2012-2014, -@comment 2016-2017 Free Software Foundation, Inc. +@comment Copyright 1988-2019 Free Software Foundation, Inc. @comment @comment This file is part of GNU tar. @comment diff --git a/doc/intern.texi b/doc/intern.texi index bfb7c37cd12e62a35543e486bdc91097356c65d8..bc4abd722767ee34f57d0ba90d5bf62f71a3bb98 100644 --- a/doc/intern.texi +++ b/doc/intern.texi @@ -1,5 +1,5 @@ @c This is part of the paxutils manual. -@c Copyright (C) 2006, 2014, 2016-2017 Free Software Foundation, Inc. +@c Copyright (C) 2006-2019 Free Software Foundation, Inc. @c This file is distributed under GFDL 1.1 or any later version @c published by the Free Software Foundation. diff --git a/doc/mastermenu.el b/doc/mastermenu.el index d7dfb003dba8d50ae2f8d889e0fcf52914a5c2a9..db2d4a92609061c62d65d8fc738853d0fd2c7dd2 100644 --- a/doc/mastermenu.el +++ b/doc/mastermenu.el @@ -1,7 +1,6 @@ ;;; mastermenu.el --- Redefinition of texinfo-master-menu-list -;; Copyright 2006-2007, 2013-2014, 2016-2017 Free Software Foundation, -;; Inc. +;; Copyright 2006-2019 Free Software Foundation, Inc. ;; Author: Sergey Poznyakoff ;; Maintainer: bug-tar@gnu.org diff --git a/doc/parse-datetime.texi b/doc/parse-datetime.texi index 9568a4a472b76ff23b4b566ab62f19b7cd203c84..193575edcafbffcdfcf6370e02805a6c3e7b343a 100644 --- a/doc/parse-datetime.texi +++ b/doc/parse-datetime.texi @@ -1,6 +1,6 @@ @c GNU date syntax documentation -@c Copyright (C) 1994-2006, 2009-2017 Free Software Foundation, Inc. +@c Copyright (C) 1994-2006, 2009-2019 Free Software Foundation, Inc. @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.3 or diff --git a/doc/recipes.texi b/doc/recipes.texi index da259da3918c7a76cd84ea13ec44fcbfedf62dc6..d4def4a92fec5884492fde287ef97ab8d1f83044 100644 --- a/doc/recipes.texi +++ b/doc/recipes.texi @@ -1,5 +1,5 @@ @c This is part of the GNU tar manual. -@c Copyright (C) 2017 Free Software Foundation, Inc. +@c Copyright (C) 2017-2019 Free Software Foundation, Inc. @c This file is distributed under GFDL 1.3 or any later version @c published by the Free Software Foundation. diff --git a/doc/rendition.texi b/doc/rendition.texi index 774599379829610ce84930d0a15d33539842fa3e..1eb81c6755c0e2d53c64d42be5b2eec656798fe7 100644 --- a/doc/rendition.texi +++ b/doc/rendition.texi @@ -1,6 +1,5 @@ @c This is part of GNU tar manual. -@c Copyright 1992, 1994-1997, 1999-2004, 2006, 2013-2014, 2016-2017 Free -@c Software Foundation, Inc. +@c Copyright 1992-2019 Free Software Foundation, Inc. @c See file tar.texi for copying conditions. @c This file contains support for 'renditions' by Fran@,{c}ois Pinard diff --git a/doc/rmt.8 b/doc/rmt.8 index 7550277179089e677abbbdfb33e331d53089dc40..574352e2b1fc437f6615214f9d5369e137e39649 100644 --- a/doc/rmt.8 +++ b/doc/rmt.8 @@ -1,5 +1,5 @@ .\" This file is part of GNU tar. -*- nroff -*- -.\" Copyright 2013 Free Software Foundation, Inc. +.\" Copyright 2013, 2018 Free Software Foundation, Inc. .\" .\" GNU tar is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by @@ -13,7 +13,7 @@ .\" .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see . -.TH RMT 1 "January 27, 2014" "RMT" "GNU TAR Manual" +.TH RMT 8 "March 24, 2018" "RMT" "GNU TAR Manual" .SH NAME rmt \- remote magnetic tape server .SH SYNOPSIS @@ -237,7 +237,7 @@ command appeared in 4.2BSD. The GNU .BR rmt is written from scratch, using the BSD specification. .SH COPYRIGHT -Copyright \(co 2013 Free Software Foundation, Inc. +Copyright \(co 2013, 2018 Free Software Foundation, Inc. .br .na License GPLv3+: GNU GPL version 3 or later diff --git a/doc/snapshot.texi b/doc/snapshot.texi index 8ebfb781688ca5819143c3a2cd0eda773533d324..fe2cf31b228aa467c8fe40293989adfd98390aaf 100644 --- a/doc/snapshot.texi +++ b/doc/snapshot.texi @@ -1,6 +1,5 @@ @c This is part of the paxutils manual. -@c Copyright (C) 2005, 2007, 2014, 2016-2017 Free Software Foundation, -@c Inc. +@c Copyright (C) 2005-2019 Free Software Foundation, Inc. @c Written by Sergey Poznyakoff @c This file is distributed under GFDL 1.1 or any later version @c published by the Free Software Foundation. @@ -147,7 +146,7 @@ is compiled. To see the specific ranges allowed for a particular @option{--show-snapshot-field-ranges} option: @smallexample -$ @kbd{tar --show-shapshot-field-ranges} +$ @kbd{tar --show-snapshot-field-ranges} This tar's snapshot file field ranges are (field name => [ min, max ]): diff --git a/doc/sparse.texi b/doc/sparse.texi index 84fe2b0c53fb2fb53a517fe4d9442dd75f919a08..9cf14b941d96949a80382339197eaf58d1d02067 100644 --- a/doc/sparse.texi +++ b/doc/sparse.texi @@ -1,5 +1,5 @@ @c This is part of the paxutils manual. -@c Copyright (C) 2006, 2014, 2016-2017 Free Software Foundation, Inc. +@c Copyright (C) 2006-2019 Free Software Foundation, Inc. @c This file is distributed under GFDL 1.1 or any later version @c published by the Free Software Foundation. @@ -218,12 +218,12 @@ The real name of the sparse file is stored in the variable variable @code{GNU.sparse.realsize}. The sparse map itself is stored in the file data block, preceding the actual -file data. It consists of a series of octal numbers of arbitrary length, delimited +file data. It consists of a series of decimal numbers delimited by newlines. The map is padded with nulls to the nearest block boundary. -The first number gives the number of entries in the map. Following are map entries, -each one consisting of two numbers giving the offset and size of the -data block it describes. +The first number gives the number of entries in the map. Following are +map entries, each one consisting of two numbers giving the offset and +size of the data block it describes. The format is designed in such a way that non-posix aware @command{tar}s and @command{tar}s not supporting @code{GNU.sparse.*} keywords will extract each sparse file diff --git a/doc/stamp-vti b/doc/stamp-vti index 0b31161260877adab32e60fcc7cdde186a85e365..1b3ab5e46fbc1e33f3491e319275ba14f36d8f4d 100644 --- a/doc/stamp-vti +++ b/doc/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 16 December 2017 -@set UPDATED-MONTH December 2017 -@set EDITION 1.30 -@set VERSION 1.30 +@set UPDATED 4 February 2019 +@set UPDATED-MONTH February 2019 +@set EDITION 1.32 +@set VERSION 1.32 diff --git a/doc/tar-snapshot-edit.texi b/doc/tar-snapshot-edit.texi index e8e77726b1bbeacc10a65296d7f1745661c4c170..85f58cec9b18e228924aa814f63989601bb0e640 100644 --- a/doc/tar-snapshot-edit.texi +++ b/doc/tar-snapshot-edit.texi @@ -1,5 +1,5 @@ @c This is part of the paxutils manual. -@c Copyright (C) 2007, 2014, 2016-2017 Free Software Foundation, Inc. +@c Copyright (C) 2007-2019 Free Software Foundation, Inc. @c This file is distributed under GFDL 1.1 or any later version @c published by the Free Software Foundation. diff --git a/doc/tar.1 b/doc/tar.1 index ddf4fdcf3f46c91de907da17d96a1a668af62b5e..0ad69b7404c6d5ad7a2b3102fff93ff879b90036 100644 --- a/doc/tar.1 +++ b/doc/tar.1 @@ -1,5 +1,5 @@ .\" This file is part of GNU tar. -*- nroff -*- -.\" Copyright 2013-2014, 2016-2017 Free Software Foundation, Inc. +.\" Copyright 2013-2019 Free Software Foundation, Inc. .\" .\" GNU tar is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by @@ -13,7 +13,7 @@ .\" .\" You should have received a copy of the GNU General Public License .\" along with this program. If not, see . -.TH TAR 1 "November 16, 2017" "TAR" "GNU TAR Manual" +.TH TAR 1 "February 4, 2019" "TAR" "GNU TAR Manual" .SH NAME tar \- an archiving utility .SH SYNOPSIS @@ -111,7 +111,7 @@ into the archive file verbosely listing the files being archived: .PP .EX -.B tar cfv a.tar /etc +.B tar cfv etc.tar /etc .EE .PP In @@ -133,9 +133,9 @@ The example command above written in the could look like: .PP .EX -.B tar -cvf a.tar /etc +.B tar -cvf etc.tar /etc or -.B tar -c -v -f a.tar /etc +.B tar -c -v -f etc.tar /etc .EE .PP In @@ -152,11 +152,11 @@ method. Here are several ways of writing the example command in this style: .PP .EX -.B tar --create --file a.tar --verbose /etc +.B tar --create --file etc.tar --verbose /etc .EE or (abbreviating some options): .EX -.B tar --cre --file=a.tar --verb /etc +.B tar --cre --file=etc.tar --verb /etc .EE .PP The options in all three styles can be intermixed, although doing so @@ -256,7 +256,7 @@ exist when creating an archive, it will be created and all files will be added to the resulting archive (the \fBlevel 0\fR dump). To create incremental archives of non-zero level \fBN\fR, create a copy of the snapshot file created during the level \fBN-1\fR, and use it as -\fIFILE\fR. +\fIFILE\fR. When listing or extracting, the actual contents of \fIFILE\fR is not inspected, it is needed only due to syntactical requirements. It is @@ -287,7 +287,7 @@ effect only if the archive is open for reading (e.g. with .B \-\-list or .B \-\-extract -options). +options). .TP \fB\-\-no\-check\-device\fR Do not check device numbers when creating incremental archives. @@ -383,7 +383,7 @@ Extract files to standard output. Pipe extracted files to \fICOMMAND\fR. The argument is the pathname of an external program, optionally with command line arguments. The program will be invoked and the contents of the file being extracted -supplied to it on its standard output. Additional data will be +supplied to it on its standard input. Additional data will be supplied via the following environment variables: .RS .TP @@ -465,7 +465,7 @@ Format of the archive being processed. One of: .BR v7 . .B TAR_SUBCOMMAND A short option (with a leading dash) describing the operation \fBtar\fR is -executing. +executing. .RE .SS Handling of file attributes .TP @@ -562,9 +562,6 @@ stored in archive with owner name \fINEWUSR\fR and UID \fINEWUID\fR. \fB\-p\fR, \fB\-\-preserve\-permissions\fR, \fB\-\-same\-permissions\fR extract information about file permissions (default for superuser) .TP -\fB\-\-preserve\fR -Same as both \fB\-p\fR and \fB\-s\fR. -.TP \fB\-\-same\-owner\fR Try extracting files with the same ownership as exists in the archive (default for superuser). @@ -694,7 +691,7 @@ executing. .B TAR_FD File descriptor which can be used to communicate the new volume name to -.BR tar . +.BR tar . .RE .RS @@ -732,7 +729,7 @@ When this option is used in conjunction with .BR \-\-multi\-volume , .B tar will keep track of which volume of a multi-volume archive it is -working in \fIFILE\fR. +working in \fIFILE\fR. .SS Device blocking .TP \fB\-b\fR, \fB\-\-blocking\-factor\fR=\fIBLOCKS\fR @@ -740,7 +737,7 @@ Set record size to \fIBLOCKS\fRx\fB512\fR bytes. .TP \fB\-B\fR, \fB\-\-read\-full\-records\fR When listing or extracting, accept incomplete input records after -end-of-file marker. +end-of-file marker. .TP \fB\-i\fR, \fB\-\-ignore\-zeros\fR Ignore zeroed blocks in archive. Normally two consecutive 512-blocks @@ -831,6 +828,10 @@ Filter the archive through \fB\-Z\fR, \fB\-\-compress\fR, \fB\-\-uncompress\fR Filter the archive through .BR compress (1). +.TP +\fB\-\-zstd\fR +Filter the archive through +.BR zstd (1). .SS Local file selection .TP \fB\-\-add\-file\fR=\fIFILE\fR @@ -1102,7 +1103,7 @@ Show file or archive names after transformation by \fB\-\-strip\fR and Print total bytes after processing the archive. If \fISIGNAL\fR is given, print total bytes when this signal is delivered. Allowed signals are: -.BR SIGHUP , +.BR SIGHUP , .BR SIGQUIT , .BR SIGINT , .BR SIGUSR1 ", and" @@ -1113,7 +1114,11 @@ The \fBSIG\fR prefix can be omitted. Print file modification times in UTC. .TP \fB\-v\fR, \fB\-\-verbose\fR -Verbosely list files processed. +Verbosely list files processed. Each instance of this option on the +command line increases the verbosity level by one. The maximum +verbosity level is 3. For a detailed discussion of how various +verbosity levels affect tar's output, please refer to \fBGNU Tar +Manual\fR, subsection 2.5.1 "\fBThe \-\-verbose Option\fR". .TP \fB\-\-warning\fR=\fIKEYWORD\fR Enable or disable warning messages identified by \fIKEYWORD\fR. The @@ -1205,7 +1210,7 @@ default (unless \fB\-\-verbose\fR is used). A common example of what you can get when using this warning is: .EX -$ \fBtar --warning=decompress-program -x -f archive.Z +$ tar --warning=decompress-program -x -f archive.Z tar (child): cannot run compress: No such file or directory tar (child): trying gzip .EE @@ -1296,8 +1301,8 @@ failure during backup to a remote device. .BR lzop (1), .BR rmt (8), .BR symlink (7), -.BR tar (5), -.BR xz (1). +.BR xz (1), +.BR zstd (1). .PP Complete \fBtar\fR manual: run .B info tar @@ -1328,4 +1333,3 @@ There is NO WARRANTY, to the extent permitted by law. .\" time-stamp-end: "\"" .\" time-stamp-line-limit: 20 .\" end: - diff --git a/doc/tar.info b/doc/tar.info index 2981e585ae35402995372b7763240e66d3a566ab..e96e91404411757e3d4d8d422ed9b2708f72ad13 100644 --- a/doc/tar.info +++ b/doc/tar.info @@ -1,6 +1,6 @@ -This is tar.info, produced by makeinfo version 5.2 from tar.texi. +This is tar.info, produced by makeinfo version 5.9.93 from tar.texi. -This manual is for GNU 'tar' (version 1.30, 16 December 2017), which +This manual is for GNU 'tar' (version 1.32, 4 February 2019), which creates and extracts files from archives. Copyright (C) 1992, 1994-1997, 1999-2001, 2003-2017 Free Software @@ -28,442 +28,443 @@ END-INFO-DIR-ENTRY  Indirect: -tar.info-1: 1138 -tar.info-2: 302401 +tar.info-1: 1140 +tar.info-2: 303214  Tag Table: (Indirect) -Node: Top1138 -Node: Introduction10521 -Node: Book Contents11308 -Node: Definitions13480 -Node: What tar Does15283 -Node: Naming tar Archives18050 -Node: Authors18771 -Node: Reports20584 -Node: Tutorial20941 -Node: assumptions21754 -Node: stylistic conventions24228 -Node: basic tar options24671 -Node: frequent operations28310 -Node: Two Frequent Options28960 -Node: file tutorial29591 -Node: verbose tutorial30949 -Ref: verbose member listing33163 -Node: help tutorial35931 -Node: create36286 -Node: prepare for examples37724 -Node: Creating the archive39493 -Node: create verbose43080 -Node: short create43900 -Node: create dir46635 -Node: list49343 -Ref: listing member and file names50878 -Node: list dir53497 -Node: extract54509 -Node: extracting archives55623 -Node: extracting files56128 -Ref: extracting files-Footnote-158014 -Node: extract dir58394 -Node: extracting untrusted archives60786 -Node: failing commands61666 -Node: going further63251 -Node: tar invocation63464 -Node: Synopsis65244 -Ref: exit status68566 -Node: using tar options70199 -Ref: TAR_OPTIONS71779 -Node: Styles72798 -Ref: Styles-Footnote-174297 -Node: Long Options74553 -Node: Short Options76725 -Ref: Short Options-Footnote-178533 -Node: Old Options78750 -Node: Mixing81513 -Ref: Mixing-Footnote-183879 -Node: All Options83999 -Node: Operation Summary84635 -Ref: --append84755 -Ref: --catenate84836 -Ref: --compare84908 -Ref: --concatenate85112 -Ref: --create85223 -Ref: --delete85292 -Ref: --diff85407 -Ref: --extract85464 -Ref: --get85567 -Ref: --list85626 -Ref: --update85695 -Node: Option Summary85906 -Ref: --absolute-names86061 -Ref: --acls86353 -Ref: --after-date86434 -Ref: --anchored86487 -Ref: --atime-preserve86620 -Ref: --auto-compress89136 -Ref: --backup89364 -Ref: --block-number89556 -Ref: --blocking-factor89731 -Ref: --bzip289884 -Ref: --check-device89992 -Ref: --checkpoint90187 -Ref: --checkpoint-action90630 -Ref: --check-links91789 -Ref: --compress92066 -Ref: --uncompress92066 -Ref: --clamp-mtime92271 -Ref: --confirmation92311 -Ref: --delay-directory-restore92380 -Ref: --dereference92583 -Ref: --directory92778 -Ref: --exclude93032 -Ref: --exclude-backups93152 -Ref: --exclude-from93242 -Ref: --exclude-caches93389 -Ref: --exclude-caches-under93598 -Ref: --exclude-caches-all93777 -Ref: --exclude-ignore93907 -Ref: --exclude-ignore-recursive94127 -Ref: --exclude-tag94371 -Ref: --exclude-tag-under94543 -Ref: --exclude-tag-all94734 -Ref: --exclude-vcs94864 -Ref: --exclude-vcs-ignores95024 -Ref: --file95417 -Ref: --files-from95618 -Ref: --force-local95822 -Ref: --format96014 -Ref: --full-time96689 -Ref: --group97369 -Ref: --group-map97696 -Ref: --gzip98088 -Ref: --gunzip98088 -Ref: --ungzip98088 -Ref: --hard-dereference98312 -Ref: --help98499 -Ref: --hole-detection98635 -Ref: --ignore-case98871 -Ref: --ignore-command-error98998 -Ref: --ignore-failed-read99110 -Ref: --ignore-zeros99252 -Ref: --incremental99397 -Ref: --index-file99663 -Ref: --info-script99749 -Ref: --new-volume-script99749 -Ref: --interactive100047 -Ref: --keep-directory-symlink100260 -Ref: --keep-newer-files100809 -Ref: --keep-old-files100952 -Ref: --label101165 -Ref: --level101454 -Ref: --listed-incremental101894 -Ref: --lzip102259 -Ref: --lzma102360 -Ref: --mode102562 -Ref: --mtime102855 -Ref: --multi-volume103535 -Ref: --newer103741 -Ref: --newer-mtime104020 -Ref: --no-acls104245 -Ref: --no-anchored104339 -Ref: --no-auto-compress104476 -Ref: --no-check-device104628 -Ref: --no-delay-directory-restore104811 -Ref: --no-ignore-case105060 -Ref: --no-ignore-command-error105153 -Ref: --no-null105309 -Ref: --no-overwrite-dir105515 -Ref: --no-quote-chars105659 -Ref: --no-recursion105840 -Ref: --no-same-owner105946 -Ref: --no-same-permissions106130 -Ref: --no-seek106333 -Ref: --no-selinux106552 -Ref: --no-unquote106653 -Ref: --no-verbatim-files-from106791 -Ref: --no-wildcards107292 -Ref: --no-wildcards-match-slash107376 -Ref: --no-xattrs107478 -Ref: --null107581 -Ref: --numeric-owner107932 -Ref: --occurrence108584 -Ref: --old-archive109152 -Ref: --one-file-system109201 -Ref: --one-top-level109379 -Ref: --overwrite110015 -Ref: --overwrite-dir110158 -Ref: --owner110304 -Ref: --owner-map110667 -Ref: --pax-option111043 -Ref: --portability111350 -Ref: --posix111415 -Ref: --preserve-order111457 -Ref: --preserve-permissions111522 -Ref: --same-permissions111522 -Ref: --quote-chars111937 -Ref: --quoting-style112090 -Ref: --read-full-records112413 -Ref: --record-size112579 -Ref: --recursion112932 -Ref: --recursive-unlink113037 -Ref: --remove-files113200 -Ref: --restrict113347 -Ref: --rmt-command113536 -Ref: --rsh-command113678 -Ref: --same-order113801 -Ref: --same-owner114094 -Ref: --seek114473 -Ref: --selinux114844 -Ref: --show-defaults114945 -Ref: --show-omitted-dirs115455 -Ref: --show-snapshot-field-ranges115610 -Ref: --show-transformed-names115807 -Ref: --show-stored-names115807 -Ref: --skip-old-files116197 -Ref: --sort116648 -Ref: --sparse117287 -Ref: --sparse-version117427 -Ref: --starting-file117653 -Ref: --strip-components117843 -Ref: --suffix118180 -Ref: --tape-length118300 -Ref: --test-label118725 -Ref: --to-command118878 -Ref: --to-stdout119038 -Ref: --totals119192 -Ref: --touch119424 -Ref: --transform119627 -Ref: --xform119627 -Ref: --unlink-first120241 -Ref: --unquote120405 -Ref: --use-compress-program120512 -Ref: --utc120691 -Ref: --verbatim-files-from120785 -Ref: --verbose121629 -Ref: --verify121882 -Ref: --version122001 -Ref: --volno-file122174 -Ref: --warning122362 -Ref: --wildcards122540 -Ref: --wildcards-match-slash122660 -Ref: --xattrs122752 -Ref: --xattrs-exclude122851 -Ref: --xattrs-include122978 -Ref: --xz123234 -Ref: Option Summary-Footnote-1123364 -Node: Short Option Summary123583 -Node: Position-Sensitive Options126486 -Ref: Position-Sensitive Options-Footnote-1129975 -Node: help130137 -Ref: help-Footnote-1133972 -Node: defaults134183 -Node: verbose135202 -Ref: totals137505 -Ref: Progress information139095 -Ref: show-omitted-dirs140074 -Ref: block-number140493 -Ref: verbose-Footnote-1141520 -Node: checkpoints141627 -Ref: checkpoint exec147692 -Node: warnings149721 -Node: interactive153323 -Node: external155422 -Node: operations157010 -Node: Basic tar157252 -Ref: Basic tar-Footnote-1160359 -Node: Advanced tar160503 -Node: Operations161348 -Node: append163243 -Ref: append-Footnote-1166340 -Node: appending files166527 -Node: multiple168264 -Node: update170986 -Node: how to update171963 -Node: concatenate173744 -Ref: concatenate-Footnote-1176992 -Node: delete177135 -Node: compare178909 -Node: create options180343 -Node: override180830 -Node: Extended File Attributes187891 -Node: Ignore Failed Read192519 -Node: extract options193124 -Node: Reading193957 -Node: read full records195457 -Node: Ignore Zeros195792 -Node: Writing196783 -Node: Dealing with Old Files197340 -Node: Overwrite Old Files200142 -Node: Keep Old Files201599 -Node: Keep Newer Files202406 -Node: Unlink First202696 -Node: Recursive Unlink203100 -Node: Data Modification Times203653 -Node: Setting Access Permissions204463 -Node: Directory Modification Times and Permissions205095 -Node: Writing to Standard Output208708 -Node: Writing to an External Program210243 -Node: remove files213833 -Node: Scarce214026 -Node: Starting File214274 -Node: Same Order215075 -Node: backup215911 -Node: looking ahead219003 -Node: Backups219823 -Node: Full Dumps221404 -Node: Incremental Dumps223213 -Ref: --level=0226127 -Ref: device numbers226660 -Ref: incremental-op230643 -Ref: Incremental Dumps-Footnote-1231017 -Ref: Incremental Dumps-Footnote-2231167 -Node: Backup Levels231655 -Node: Backup Parameters234042 -Node: General-Purpose Variables235223 -Ref: RSH238391 -Node: Magnetic Tape Control240275 -Node: User Hooks241614 -Node: backup-specs example242947 -Node: Scripted Backups244087 -Ref: Scripted Backups-Footnote-1246952 -Node: Scripted Restoration247336 -Node: Choosing249942 -Node: file251064 -Ref: remote-dev253700 -Ref: local and remote archives254085 -Node: Selecting Archive Members255116 -Ref: input name quoting255797 -Node: files257772 -Ref: verbatim-files-from260479 -Ref: no-verbatim-files-from260739 -Ref: files-Footnote-1261481 -Node: nul261639 -Node: exclude264097 -Ref: exclude-vcs-ignores265655 -Ref: exclude-vcs267368 -Ref: exclude-Footnote-1271304 -Ref: exclude-Footnote-2271558 -Node: problems with exclude271629 -Node: wildcards273679 -Node: controlling pattern-matching276262 -Ref: anchored patterns278903 -Ref: case-insensitive matches279173 -Ref: controlling pattern-matching-Footnote-1280250 -Node: quoting styles280467 -Ref: escape sequences280812 -Node: transform286756 -Ref: show-transformed-names288747 -Node: after294938 -Node: recurse298540 -Node: one302401 -Node: directory303834 -Node: absolute306933 -Ref: absolute-Footnote-1310260 -Node: Date input formats310611 -Node: General date syntax313007 -Node: Calendar date items315984 -Node: Time of day items317981 -Node: Time zone items320177 -Node: Combined date and time of day items321427 -Node: Day of week items322282 -Node: Relative items in date strings323290 -Node: Pure numbers in date strings326092 -Node: Seconds since the Epoch327073 -Node: Specifying time zone rules328693 -Node: Authors of parse_datetime331066 -Ref: Authors of get_date331245 -Node: Formats332208 -Node: Compression336883 -Node: gzip337175 -Ref: alternative decompression programs339386 -Ref: auto-compress342935 -Ref: use-compress-program343700 -Ref: gzip-Footnote-1345667 -Ref: gzip-Footnote-2345716 -Node: lbzip2345856 -Node: sparse346953 -Node: Attributes351497 -Node: Portability357159 -Node: Portable Names358645 -Node: dereference359350 -Node: hard links360477 -Ref: hard links-Footnote-1363362 -Node: old363418 -Node: ustar364601 -Node: gnu365204 -Node: posix366081 -Node: PAX keywords366562 -Node: Checksumming372560 -Node: Large or Negative Values374504 -Node: Other Tars376105 -Node: Split Recovery377241 -Node: Sparse Recovery380990 -Ref: extracting sparse v0x384619 -Ref: Sparse Recovery-Footnote-1387908 -Ref: Sparse Recovery-Footnote-2387931 -Node: cpio388052 -Node: Media392813 -Node: Device394764 -Ref: size-suffixes399555 -Node: Remote Tape Server400695 -Node: Common Problems and Solutions404359 -Node: Blocking404751 -Ref: Blocking-Footnote-1411235 -Node: Format Variations411339 -Node: Blocking Factor412254 -Node: Many423905 -Node: Tape Positioning427699 -Node: mt429575 -Node: Using Multiple Tapes431132 -Node: Multi-Volume Archives433198 -Ref: tape-length434683 -Ref: change volume prompt435238 -Ref: volno-file436105 -Ref: info-script436658 -Ref: Multi-Volume Archives-Footnote-1442243 -Ref: Multi-Volume Archives-Footnote-2442353 -Node: Tape Files442421 -Node: Tarcat443906 -Node: label444951 -Ref: --test-label option446539 -Ref: label-Footnote-1449990 -Ref: label-Footnote-2450099 -Ref: label-Footnote-3450232 -Node: verify450467 -Node: Write Protection453767 -Node: Reliability and security454597 -Node: Reliability454985 -Node: Permissions problems455763 -Node: Data corruption and repair456202 -Node: Race conditions457129 -Node: Security458868 -Node: Privacy459471 -Node: Integrity460720 -Node: Live untrusted data462931 -Node: Security rules of thumb465270 -Node: Changes466798 -Node: Recipes470387 -Node: copy directory hierarchy470672 -Node: intermediate directories471476 -Ref: intermediate directories-Footnote-1473841 -Node: Configuring Help Summary473965 -Node: Fixing Snapshot Files480481 -Node: Tar Internals483850 -Node: Standard484182 -Node: Extensions506324 -Node: Sparse Formats509614 -Node: Old GNU Format510903 -Node: PAX 0513290 -Node: PAX 1516404 -Node: Snapshot Files518132 -Node: Dumpdir523730 -Node: Genfile526960 -Node: Generate Mode528056 -Node: Status Mode533296 -Node: Exec Mode535098 -Node: Free Software Needs Free Documentation537944 -Node: GNU Free Documentation License542925 -Node: Index of Command Line Options568133 -Node: Index596359 +Node: Top1140 +Node: Introduction10522 +Node: Book Contents11309 +Node: Definitions13481 +Node: What tar Does15284 +Node: Naming tar Archives18051 +Node: Authors18772 +Node: Reports20585 +Node: Tutorial20942 +Node: assumptions21755 +Node: stylistic conventions24229 +Node: basic tar options24672 +Node: frequent operations28311 +Node: Two Frequent Options28961 +Node: file tutorial29592 +Node: verbose tutorial30950 +Ref: verbose member listing33164 +Node: help tutorial35932 +Node: create36287 +Node: prepare for examples37725 +Node: Creating the archive39494 +Node: create verbose43081 +Node: short create43901 +Node: create dir46636 +Node: list49344 +Ref: listing member and file names50879 +Node: list dir53498 +Node: extract54510 +Node: extracting archives55624 +Node: extracting files56129 +Ref: extracting files-Footnote-158015 +Node: extract dir58395 +Node: extracting untrusted archives60787 +Node: failing commands61667 +Node: going further63252 +Node: tar invocation63465 +Node: Synopsis65245 +Ref: exit status68567 +Node: using tar options70200 +Ref: TAR_OPTIONS71780 +Node: Styles72799 +Ref: Styles-Footnote-174298 +Node: Long Options74554 +Node: Short Options76726 +Ref: Short Options-Footnote-178534 +Node: Old Options78751 +Node: Mixing81514 +Ref: Mixing-Footnote-183880 +Node: All Options84000 +Node: Operation Summary84636 +Ref: --append84756 +Ref: --catenate84837 +Ref: --compare84909 +Ref: --concatenate85113 +Ref: --create85224 +Ref: --delete85293 +Ref: --diff85408 +Ref: --extract85465 +Ref: --get85568 +Ref: --list85627 +Ref: --update85696 +Node: Option Summary85907 +Ref: --absolute-names86062 +Ref: --acls86354 +Ref: --after-date86435 +Ref: --anchored86488 +Ref: --atime-preserve86621 +Ref: --auto-compress89137 +Ref: --backup89365 +Ref: --block-number89557 +Ref: --blocking-factor89732 +Ref: --bzip289885 +Ref: --check-device89993 +Ref: --checkpoint90188 +Ref: --checkpoint-action90631 +Ref: --check-links91902 +Ref: --compress92179 +Ref: --uncompress92179 +Ref: --clamp-mtime92384 +Ref: --confirmation92424 +Ref: --delay-directory-restore92493 +Ref: --dereference92696 +Ref: --directory92891 +Ref: --exclude93145 +Ref: --exclude-backups93265 +Ref: --exclude-from93355 +Ref: --exclude-caches93502 +Ref: --exclude-caches-under93711 +Ref: --exclude-caches-all93890 +Ref: --exclude-ignore94020 +Ref: --exclude-ignore-recursive94240 +Ref: --exclude-tag94484 +Ref: --exclude-tag-under94656 +Ref: --exclude-tag-all94847 +Ref: --exclude-vcs94977 +Ref: --exclude-vcs-ignores95137 +Ref: --file95530 +Ref: --files-from95731 +Ref: --force-local95935 +Ref: --format96127 +Ref: --full-time96802 +Ref: --group97482 +Ref: --group-map97809 +Ref: --gzip98201 +Ref: --gunzip98201 +Ref: --ungzip98201 +Ref: --hard-dereference98425 +Ref: --help98612 +Ref: --hole-detection98748 +Ref: --ignore-case98984 +Ref: --ignore-command-error99111 +Ref: --ignore-failed-read99223 +Ref: --ignore-zeros99365 +Ref: --incremental99510 +Ref: --index-file99776 +Ref: --info-script99862 +Ref: --new-volume-script99862 +Ref: --interactive100160 +Ref: --keep-directory-symlink100373 +Ref: --keep-newer-files100922 +Ref: --keep-old-files101065 +Ref: --label101278 +Ref: --level101567 +Ref: --listed-incremental102007 +Ref: --lzip102372 +Ref: --lzma102473 +Ref: --mode102675 +Ref: --mtime102968 +Ref: --multi-volume103648 +Ref: --newer103854 +Ref: --newer-mtime104133 +Ref: --no-acls104358 +Ref: --no-anchored104452 +Ref: --no-auto-compress104589 +Ref: --no-check-device104741 +Ref: --no-delay-directory-restore104924 +Ref: --no-ignore-case105173 +Ref: --no-ignore-command-error105266 +Ref: --no-null105422 +Ref: --no-overwrite-dir105628 +Ref: --no-quote-chars105772 +Ref: --no-recursion105953 +Ref: --no-same-owner106059 +Ref: --no-same-permissions106243 +Ref: --no-seek106446 +Ref: --no-selinux106665 +Ref: --no-unquote106766 +Ref: --no-verbatim-files-from106904 +Ref: --no-wildcards107405 +Ref: --no-wildcards-match-slash107489 +Ref: --no-xattrs107591 +Ref: --null107694 +Ref: --numeric-owner108045 +Ref: --occurrence108697 +Ref: --old-archive109265 +Ref: --one-file-system109314 +Ref: --one-top-level109492 +Ref: --overwrite110128 +Ref: --overwrite-dir110271 +Ref: --owner110417 +Ref: --owner-map110780 +Ref: --pax-option111156 +Ref: --portability111463 +Ref: --posix111528 +Ref: --preserve-order111570 +Ref: --preserve-permissions111635 +Ref: --same-permissions111635 +Ref: --quote-chars112050 +Ref: --quoting-style112203 +Ref: --read-full-records112526 +Ref: --record-size112692 +Ref: --recursion113045 +Ref: --recursive-unlink113150 +Ref: --remove-files113313 +Ref: --restrict113460 +Ref: --rmt-command113649 +Ref: --rsh-command113791 +Ref: --same-order113914 +Ref: --same-owner114207 +Ref: --seek114586 +Ref: --selinux114957 +Ref: --show-defaults115058 +Ref: --show-omitted-dirs115568 +Ref: --show-snapshot-field-ranges115723 +Ref: --show-transformed-names115920 +Ref: --show-stored-names115920 +Ref: --skip-old-files116310 +Ref: --sort116761 +Ref: --sparse117400 +Ref: --sparse-version117540 +Ref: --starting-file117766 +Ref: --strip-components117956 +Ref: --suffix118293 +Ref: --tape-length118413 +Ref: --test-label118838 +Ref: --to-command118991 +Ref: --to-stdout119151 +Ref: --totals119305 +Ref: --touch119537 +Ref: --transform119740 +Ref: --xform119740 +Ref: --unlink-first120354 +Ref: --unquote120518 +Ref: --use-compress-program120625 +Ref: --utc120804 +Ref: --verbatim-files-from120898 +Ref: --verbose121742 +Ref: --verify121995 +Ref: --version122114 +Ref: --volno-file122287 +Ref: --warning122475 +Ref: --wildcards122653 +Ref: --wildcards-match-slash122773 +Ref: --xattrs122865 +Ref: --xattrs-exclude122964 +Ref: --xattrs-include123091 +Ref: --xz123347 +Ref: Option Summary-Footnote-1123570 +Node: Short Option Summary123789 +Node: Position-Sensitive Options126701 +Ref: Position-Sensitive Options-Footnote-1130190 +Node: help130352 +Ref: help-Footnote-1134187 +Node: defaults134398 +Node: verbose135417 +Ref: totals137720 +Ref: Progress information139310 +Ref: show-omitted-dirs140289 +Ref: block-number140708 +Ref: verbose-Footnote-1141735 +Node: checkpoints141842 +Ref: checkpoint wait147907 +Ref: checkpoint exec148503 +Node: warnings150532 +Node: interactive154134 +Node: external156233 +Node: operations157821 +Node: Basic tar158063 +Ref: Basic tar-Footnote-1161170 +Node: Advanced tar161314 +Node: Operations162159 +Node: append164054 +Ref: append-Footnote-1167151 +Node: appending files167338 +Node: multiple169075 +Node: update171797 +Node: how to update172774 +Node: concatenate174555 +Ref: concatenate-Footnote-1177803 +Node: delete177946 +Node: compare179720 +Node: create options181154 +Node: override181641 +Node: Extended File Attributes188702 +Node: Ignore Failed Read193330 +Node: extract options193935 +Node: Reading194768 +Node: read full records196268 +Node: Ignore Zeros196603 +Node: Writing197594 +Node: Dealing with Old Files198151 +Node: Overwrite Old Files200953 +Node: Keep Old Files202410 +Node: Keep Newer Files203217 +Node: Unlink First203507 +Node: Recursive Unlink203911 +Node: Data Modification Times204464 +Node: Setting Access Permissions205274 +Node: Directory Modification Times and Permissions205906 +Node: Writing to Standard Output209519 +Node: Writing to an External Program211054 +Node: remove files214644 +Node: Scarce214837 +Node: Starting File215085 +Node: Same Order215886 +Node: backup216722 +Node: looking ahead219814 +Node: Backups220634 +Node: Full Dumps222215 +Node: Incremental Dumps224024 +Ref: --level=0226938 +Ref: device numbers227471 +Ref: incremental-op231454 +Ref: Incremental Dumps-Footnote-1231828 +Ref: Incremental Dumps-Footnote-2231978 +Node: Backup Levels232466 +Node: Backup Parameters234853 +Node: General-Purpose Variables236034 +Ref: RSH239202 +Node: Magnetic Tape Control241086 +Node: User Hooks242425 +Node: backup-specs example243758 +Node: Scripted Backups244898 +Ref: Scripted Backups-Footnote-1247763 +Node: Scripted Restoration248147 +Node: Choosing250753 +Node: file251875 +Ref: remote-dev254511 +Ref: local and remote archives254896 +Node: Selecting Archive Members255927 +Ref: input name quoting256608 +Node: files258583 +Ref: verbatim-files-from261290 +Ref: no-verbatim-files-from261550 +Ref: files-Footnote-1262292 +Node: nul262450 +Node: exclude264908 +Ref: exclude-vcs-ignores266466 +Ref: exclude-vcs268179 +Ref: exclude-Footnote-1272115 +Ref: exclude-Footnote-2272369 +Node: problems with exclude272440 +Node: wildcards274490 +Node: controlling pattern-matching277073 +Ref: anchored patterns279714 +Ref: case-insensitive matches279984 +Ref: controlling pattern-matching-Footnote-1281061 +Node: quoting styles281278 +Ref: escape sequences281623 +Node: transform287567 +Ref: show-transformed-names289558 +Node: after295749 +Node: recurse299351 +Node: one303214 +Node: directory304647 +Node: absolute307746 +Ref: absolute-Footnote-1311073 +Node: Date input formats311424 +Node: General date syntax313820 +Node: Calendar date items316797 +Node: Time of day items318794 +Node: Time zone items320990 +Node: Combined date and time of day items322240 +Node: Day of week items323095 +Node: Relative items in date strings324103 +Node: Pure numbers in date strings326905 +Node: Seconds since the Epoch327886 +Node: Specifying time zone rules329506 +Node: Authors of parse_datetime331879 +Ref: Authors of get_date332058 +Node: Formats333021 +Node: Compression337696 +Node: gzip337988 +Ref: alternative decompression programs340473 +Ref: auto-compress344072 +Ref: use-compress-program344907 +Ref: gzip-Footnote-1346874 +Ref: gzip-Footnote-2346923 +Node: lbzip2347063 +Node: sparse348160 +Node: Attributes352704 +Node: Portability358366 +Node: Portable Names359852 +Node: dereference360557 +Node: hard links361684 +Ref: hard links-Footnote-1364569 +Node: old364625 +Node: ustar365808 +Node: gnu366411 +Node: posix367288 +Node: PAX keywords367769 +Node: Checksumming373767 +Node: Large or Negative Values375711 +Node: Other Tars377312 +Node: Split Recovery378448 +Node: Sparse Recovery382197 +Ref: extracting sparse v0x385826 +Ref: Sparse Recovery-Footnote-1389115 +Ref: Sparse Recovery-Footnote-2389138 +Node: cpio389259 +Node: Media394020 +Node: Device395971 +Ref: size-suffixes400762 +Node: Remote Tape Server401902 +Node: Common Problems and Solutions405566 +Node: Blocking405958 +Ref: Blocking-Footnote-1412442 +Node: Format Variations412546 +Node: Blocking Factor413461 +Node: Many425112 +Node: Tape Positioning428906 +Node: mt430782 +Node: Using Multiple Tapes432339 +Node: Multi-Volume Archives434405 +Ref: tape-length435890 +Ref: change volume prompt436445 +Ref: volno-file437312 +Ref: info-script437865 +Ref: Multi-Volume Archives-Footnote-1443450 +Ref: Multi-Volume Archives-Footnote-2443560 +Node: Tape Files443628 +Node: Tarcat445113 +Node: label446158 +Ref: --test-label option447746 +Ref: label-Footnote-1451197 +Ref: label-Footnote-2451306 +Ref: label-Footnote-3451439 +Node: verify451674 +Node: Write Protection454974 +Node: Reliability and security455804 +Node: Reliability456192 +Node: Permissions problems456970 +Node: Data corruption and repair457409 +Node: Race conditions458336 +Node: Security460075 +Node: Privacy460678 +Node: Integrity461927 +Node: Live untrusted data464138 +Node: Security rules of thumb466477 +Node: Changes468005 +Node: Recipes471594 +Node: copy directory hierarchy471879 +Node: intermediate directories472683 +Ref: intermediate directories-Footnote-1475048 +Node: Configuring Help Summary475172 +Node: Fixing Snapshot Files481688 +Node: Tar Internals485057 +Node: Standard485389 +Node: Extensions507531 +Node: Sparse Formats510821 +Node: Old GNU Format512110 +Node: PAX 0514497 +Node: PAX 1517611 +Node: Snapshot Files519320 +Node: Dumpdir524918 +Node: Genfile528148 +Node: Generate Mode529244 +Node: Status Mode534484 +Node: Exec Mode536286 +Node: Free Software Needs Free Documentation539342 +Node: GNU Free Documentation License544323 +Node: Index of Command Line Options569498 +Node: Index597797  End Tag Table diff --git a/doc/tar.info-1 b/doc/tar.info-1 index dc01ffba0baf41e8b43b2b7b5a899915f29ef0a0..5273a7bd6832ad377650af6551f58500d0d103e4 100644 --- a/doc/tar.info-1 +++ b/doc/tar.info-1 @@ -1,6 +1,6 @@ -This is tar.info, produced by makeinfo version 5.2 from tar.texi. +This is tar.info, produced by makeinfo version 5.9.93 from tar.texi. -This manual is for GNU 'tar' (version 1.30, 16 December 2017), which +This manual is for GNU 'tar' (version 1.32, 4 February 2019), which creates and extracts files from archives. Copyright (C) 1992, 1994-1997, 1999-2001, 2003-2017 Free Software @@ -32,7 +32,7 @@ File: tar.info, Node: Top, Next: Introduction, Up: (dir) GNU tar: an archiver tool ************************* -This manual is for GNU 'tar' (version 1.30, 16 December 2017), which +This manual is for GNU 'tar' (version 1.32, 4 February 2019), which creates and extracts files from archives. Copyright (C) 1992, 1994-1997, 1999-2001, 2003-2017 Free Software @@ -566,7 +566,7 @@ in version 1.11. Thomas Bushnell, n/BSG and Amy Gorin worked on a tutorial and manual for GNU 'tar'. Franc,ois Pinard put version 1.11.8 of the manual together by taking information from all these sources and merging them. Melissa Weisshaus finally edited and redesigned the book -to create version 1.12. The book for versions from 1.14 up to 1.30 were +to create version 1.12. The book for versions from 1.14 up to 1.32 were edited by the current maintainer, Sergey Poznyakoff. For version 1.12, Daniel Hagerty contributed a great deal of @@ -1312,7 +1312,7 @@ Consider this example, run from your home directory: /home/myself/practice/folk /home/myself/practice/jazz /home/myself/practice/collection.tar - $ tar --test --file practice.tar + $ tar --list --file practice.tar home/myself/practice/ home/myself/practice/blues home/myself/practice/folk @@ -1337,7 +1337,7 @@ GNU 'tar' show member names when creating archive by supplying home/myself/practice/folk home/myself/practice/jazz home/myself/practice/collection.tar - $ tar --test --file practice.tar + $ tar --list --file practice.tar home/myself/practice/ home/myself/practice/blues home/myself/practice/folk @@ -1910,10 +1910,11 @@ function; they are interchangeable. Short options which require arguments take their arguments immediately following the option, usually separated by white space. It is also possible to stick the argument right after the short option -name, using no intervening space. For example, you might write '-f archive.tar' -or '-farchive.tar' instead of using '--file=archive.tar'. Both -'--file=ARCHIVE-NAME' and '-f ARCHIVE-NAME' denote the option which -indicates a specific archive, here named 'archive.tar'. +name, using no intervening space. For example, you might write +'-f archive.tar' or '-farchive.tar' instead of using +'--file=archive.tar'. Both '--file=ARCHIVE-NAME' and '-f ARCHIVE-NAME' +denote the option which indicates a specific archive, here named +'archive.tar'. Short options which take optional arguments take their arguments immediately following the option letter, _without any intervening white @@ -1980,8 +1981,9 @@ Here, '20' is the argument of '-b' and '/dev/rmt0' is the argument of with their corresponding arguments, and is often confusing. In the command 'tar cvbf 20 /dev/rmt0', for example, '20' is the argument for '-b', '/dev/rmt0' is the argument for '-f', and '-v' does not have a -corresponding argument. Even using short options like in 'tar -c -v -b 20 -f /dev/rmt0' -is clearer, putting all arguments next to the option they pertain to. +corresponding argument. Even using short options like in +'tar -c -v -b 20 -f /dev/rmt0' is clearer, putting all arguments next to +the option they pertain to. If you want to reorder the letters in the old option argument, be sure to reorder any corresponding argument appropriately. @@ -2305,6 +2307,12 @@ File: tar.info, Node: Option Summary, Next: Short Option Summary, Prev: Opera ttyout=STRING Output STRING on the current console ('/dev/tty'). + totals + Print statistics (see *note totals::). + + wait=SIGNO + Wait for signal SIGNO. + Several '--checkpoint-action' options can be specified. The supplied actions will be executed in order of their appearance in the command line. @@ -2628,7 +2636,7 @@ File: tar.info, Node: Option Summary, Next: Short Option Summary, Prev: Opera pattern specified in NAME. *Note Tape Files::. '--level=N' - Force incremental backup of level N. As of GNU 'tar' version 1.30, + Force incremental backup of level N. As of GNU 'tar' version 1.32, the option '--level=0' truncates the snapshot file, thereby forcing the level 0 dump. Other values of N are effectively ignored. *Note --level=0::, for details and examples. @@ -3125,8 +3133,8 @@ File: tar.info, Node: Option Summary, Next: Short Option Summary, Prev: Opera '--tape-length=NUM[SUF]' '-L NUM[SUF]' - Specifies the length of tapes that 'tar' is writing as being NUM x 1024 - bytes long. If optional SUF is given, it specifies a + Specifies the length of tapes that 'tar' is writing as being + NUM x 1024 bytes long. If optional SUF is given, it specifies a multiplicative factor to be used instead of 1024. For example, '-L2M' means 2 megabytes. *Note Table 9.1: size-suffixes, for a list of allowed suffixes. *Note Using Multiple Tapes::, for a @@ -3284,6 +3292,10 @@ File: tar.info, Node: Option Summary, Next: Short Option Summary, Prev: Opera Use 'xz' for compressing or decompressing the archives. *Note gzip::. +'--zstd' + Use 'zstd' for compressing or decompressing the archives. *Note + gzip::. + ---------- Footnotes ---------- (1) Earlier versions of GNU 'tar' understood '-l' as a synonym for @@ -3365,8 +3377,8 @@ Short Option Reference -m *note --touch::. --o When creating, *note --no-same-owner::, when extracting - -- *note --portability::. +-o When extracting, same as *note --no-same-owner::. When + creating, - *note --old-archive::. The latter usage is deprecated. It is retained for compatibility with the earlier versions of GNU 'tar'. @@ -3530,8 +3542,8 @@ about its name, version, origin and legal status, all on standard output, and then exit successfully. For example, 'tar --version' might print: - tar (GNU tar) 1.30 - Copyright (C) 2013-2017 Free Software Foundation, Inc. + tar (GNU tar) 1.32 + Copyright (C) 2013-2019 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. @@ -3912,6 +3924,21 @@ checkpoint: $ tar -c --checkpoint=1000 --checkpoint-action=sleep=30 + The 'wait=SIGNO' action stops further execution until the signal +SIGNO is delivered. Valid values for SIGNO are: 'SIGHUP', 'SIGQUIT', +'SIGINT', 'SIGUSR1' and 'SIGUSR2'. The 'SIG' prefix is optional. For +example: + + $ tar -c -f arc --checkpoint=1000 --checkpoint-action wait=USR1 . + + In this example, GNU 'tar' will stop archivation at each 1000th +checkpoint. wait until the 'SIGUSR1' signal is delivered, and resume +processing. + + This action is used by the 'genfile' utility to perform modifications +on the input files upon hitting certain checkpoints (*note genfile: Exec +Mode.). + Finally, the 'exec' action executes a given external command. For example: @@ -6929,7 +6956,7 @@ options provide such possibility: systems: 'CVS', 'RCS', 'SCCS', 'SVN', 'Arch', 'Bazaar', 'Mercurial', and 'Darcs'. - As of version 1.30, the following files are excluded: + As of version 1.32, the following files are excluded: * 'CVS/', and everything under it * 'RCS/', and everything under it @@ -7058,7 +7085,7 @@ entirely: (1) According to the Bazaar docs, globbing-patterns are Korn-shell style and regular expressions are perl-style. As of GNU 'tar' version -1.30, these are treated as shell-style globs and posix extended regexps. +1.32, these are treated as shell-style globs and posix extended regexps. This will be fixed in future releases. (2) Support for perl-style regexps will appear in future releases. diff --git a/doc/tar.info-2 b/doc/tar.info-2 index e8494b817cc96a2c1e79d409e9936fc8565d94c6..c35abc4cf3189051e8fa3631dada19740e03fd5e 100644 --- a/doc/tar.info-2 +++ b/doc/tar.info-2 @@ -1,6 +1,6 @@ -This is tar.info, produced by makeinfo version 5.2 from tar.texi. +This is tar.info, produced by makeinfo version 5.9.93 from tar.texi. -This manual is for GNU 'tar' (version 1.30, 16 December 2017), which +This manual is for GNU 'tar' (version 1.32, 4 February 2019), which creates and extracts files from archives. Copyright (C) 1992, 1994-1997, 1999-2001, 2003-2017 Free Software @@ -750,7 +750,7 @@ v7 This format has traditionally been used by Automake when producing Makefiles. This practice will change in the future, in the meantime, however this means that projects containing file names - more than 99 characters long will not be able to use GNU 'tar' 1.30 + more than 99 characters long will not be able to use GNU 'tar' 1.32 and Automake prior to 1.9. ustar @@ -832,19 +832,27 @@ File: tar.info, Node: gzip, Next: sparse, Up: Compression GNU 'tar' is able to create and read compressed archives. It supports a wide variety of compression programs, namely: 'gzip', 'bzip2', 'lzip', -'lzma', 'lzop', 'xz' and traditional 'compress'. The latter is +'lzma', 'lzop', 'zstd', 'xz' and traditional 'compress'. The latter is supported mostly for backward compatibility, and we recommend against using it, because it is by far less effective than the other compression programs(1). Creating a compressed archive is simple: you just specify a "compression option" along with the usual archive creation commands. -The compression option is '-z' ('--gzip') to create a 'gzip' compressed -archive, '-j' ('--bzip2') to create a 'bzip2' compressed archive, -'--lzip' to create an lzip compressed archive, '-J' ('--xz') to create -an XZ archive, '--lzma' to create an LZMA compressed archive, '--lzop' -to create an LZOP archive, and '-Z' ('--compress') to use 'compress' -program. For example: +Available compression options are summarized in the table below: + +Long Short Archive format +--------------------------------------------------------------------------- +'--gzip' '-z' 'gzip' +'--bzip2' '-j' 'bzip2' +'--xz' '-J' 'xz' +'--lzip' 'lzip' +'--lzma' 'lzma' +'--lzop' 'lzop' +'--zstd' 'zstd' +'--compress' '-Z' 'compress' + + For example: $ tar czf archive.tar.gz . @@ -881,7 +889,7 @@ a list of recognized suffixes). Some compression programs are able to handle different compression formats. GNU 'tar' uses this, if the principal decompressor for the given format is not available. For example, if 'compress' is not -installed, 'tar' will try to use 'gzip'. As of version 1.30 the +installed, 'tar' will try to use 'gzip'. As of version 1.32 the following alternatives are tried(2): Format Main decompressor Alternatives @@ -937,6 +945,9 @@ program: '--lzop' Filter the archive through 'lzop'. +'--zstd' + Filter the archive through 'zstd'. + '-Z' '--compress' '--uncompress' @@ -995,6 +1006,8 @@ compressed archives. These are: '.tlz' 'lzma' '.lzo' 'lzop' '.xz' 'xz' + '.zst' 'zstd' + '.tzst' 'zstd' '--use-compress-program=COMMAND' '-I=COMMAND' @@ -4936,9 +4949,9 @@ constructed using the following pattern: 'GNU.sparse.realsize'. The sparse map itself is stored in the file data block, preceding the -actual file data. It consists of a series of octal numbers of arbitrary -length, delimited by newlines. The map is padded with nulls to the -nearest block boundary. +actual file data. It consists of a series of decimal numbers delimited +by newlines. The map is padded with nulls to the nearest block +boundary. The first number gives the number of entries in the map. Following are map entries, each one consisting of two numbers giving the offset @@ -4963,13 +4976,13 @@ backups (*note Incremental Dumps::). It contains the status of the file system at the time of the dump and is used to determine which files were modified since the last backup. - GNU 'tar' version 1.30 supports three snapshot file formats. The + GNU 'tar' version 1.32 supports three snapshot file formats. The first format, called "format 0", is the one used by GNU 'tar' versions up to and including 1.15.1. The second format, called "format 1" is an extended version of this format, that contains more metadata and allows for further extensions. It was used by alpha release version 1.15.90. For alpha version 1.15.91 and stable releases version 1.16 up through -1.30, the "format 2" is used. +1.32, the "format 2" is used. GNU 'tar' is able to read all three formats, but will create snapshots only in format 2. @@ -5028,7 +5041,7 @@ snapshots only in format 2. 2. 'Format 2' snapshot file begins with a format identifier, as described for version 1, e.g.: - GNU tar-1.30-2 + GNU tar-1.32-2 This line is followed by newline. Rest of file consists of records, separated by null (ASCII 0) characters. Thus, in contrast @@ -5056,8 +5069,8 @@ snapshots only in format 2. ino Number I-node number; name String Directory name; in contrast to the previous versions it is not quoted; - contents Dumpdir Contents of the directory; *Note - Dumpdir::, for a description of its + contents Dumpdir Contents of the directory; + *Note Dumpdir::, for a description of its format. Dumpdirs stored in snapshot files contain only records of types @@ -5069,7 +5082,7 @@ snapshots only in format 2. 'tar' binary, you can use the '--show-snapshot-field-ranges' option: - $ tar --show-shapshot-field-ranges + $ tar --show-snapshot-field-ranges This tar's snapshot file field ranges are (field name => [ min, max ]): @@ -5439,13 +5452,35 @@ F.3 Exec Mode ============= This mode is designed for testing the behavior of 'paxutils' commands -when some of the files change during archiving. It is an experimental -mode. +when some of the files change during archiving. It supposes that the +command being executed supports '--checkpoint' and '--checkpoint-action' +options (*note Checkpoints: (tar)checkpoints.). + + The 'Exec Mode' is enabled by '--run' command line option (or its +alias '-r'). The non-optional arguments supply the command line to be +executed. 'Genfile' modifies this command line by inserting the +following options between the command name and first argument: + + --checkpoint=N + --checkpoint-action "echo=genfile checkpoint %u" + --checkpoint-action "wait=SIGUSR1" + + Here, N stands for the checkpoint granularity (for GNU 'tar', it is +the number of archive records read or written between each pair of +checkpoints). The default value is 1. This value can be changed using +the optional argument to the '--run' option. For example, to run +actions on each 10th checkpoint: + + genfile --run=10 ... + + If the command line contains options, it must be preceded by a +double-dash ('--'), which will prevent these options from being +interpreted by 'genfile' itself. For example: - The 'Exec Mode' is toggled by '--run' command line option (or its -alias '-r'). The non-optional arguments to 'getopt' give the command -line to be executed. Normally, it should contain at least the -'--checkpoint' option. + genfile --run --checkpoint=2 --truncate foo -- tar -c -f a.tar . + + Notice also, that when running 'tar', its command line may not +contain traditional options (cluster of letters without dash). A set of options is provided for defining checkpoint values and actions to be executed upon reaching them. Checkpoint values are @@ -5487,30 +5522,8 @@ exit status of the command. connected to descriptor 1. All messages it prints to file descriptor 2, except checkpoint notifications, are forwarded to standard error. - 'Genfile' exits with the exit status of the executed command. - - For compatibility with previous 'genfile' versions, the '--run' -option takes an optional argument. If used this way, its argument -supplies the command line to be executed. There should be no -non-optional arguments in the 'genfile' command line. - - The actual command line is constructed by inserting the -'--checkpoint' option between the command name and its first argument -(if any). Due to this, the argument to '--run' may not use traditional -'tar' option syntax, i.e., the following is wrong: - - # Wrong! - genfile --run='tar cf foo bar' - - Use the following syntax instead: - - genfile --run='tar -cf foo bar' ACTIONS... - - The above command line is equivalent to - - genfile ACTIONS... -- tar -cf foo bar - - Notice, that the use of compatibility mode is deprecated. + In exec mode, 'genfile' exits with the exit status of the executed +command.  File: tar.info, Node: Free Software Needs Free Documentation, Next: GNU Free Documentation License, Prev: Genfile, Up: Top @@ -5612,8 +5625,7 @@ Appendix H GNU Free Documentation License Version 1.3, 3 November 2008 - Copyright (C) 2000-2002, 2007-2008, 2014, 2016-2017 Free - Software Foundation, Inc. + Copyright (C) 2000-2019 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies @@ -6115,7 +6127,7 @@ Summary::. * append, summary: Operation Summary. (line 6) * atime-preserve: Attributes. (line 10) * atime-preserve, summary: Option Summary. (line 25) -* auto-compress: gzip. (line 150) +* auto-compress: gzip. (line 161) * auto-compress, summary: Option Summary. (line 71) * backup: backup. (line 41) * backup, summary: Option Summary. (line 78) @@ -6129,21 +6141,21 @@ Summary::. * check-device, described: Incremental Dumps. (line 107) * check-device, summary: Option Summary. (line 103) * check-links, described: hard links. (line 31) -* check-links, summary: Option Summary. (line 155) +* check-links, summary: Option Summary. (line 161) * checkpoint: checkpoints. (line 6) * checkpoint, defined: checkpoints. (line 13) * checkpoint, summary: Option Summary. (line 108) * checkpoint-action: checkpoints. (line 6) * checkpoint-action, defined: checkpoints. (line 22) * checkpoint-action, summary: Option Summary. (line 117) -* clamp-mtime, summary: Option Summary. (line 172) +* clamp-mtime, summary: Option Summary. (line 178) * compare: compare. (line 6) * compare, summary: Operation Summary. (line 16) -* compress: gzip. (line 113) -* compress, summary: Option Summary. (line 164) +* compress: gzip. (line 124) +* compress, summary: Option Summary. (line 170) * concatenate: concatenate. (line 6) * concatenate, summary: Operation Summary. (line 23) -* confirmation, summary: Option Summary. (line 176) +* confirmation, summary: Option Summary. (line 182) * create, additional options: create options. (line 6) * create, complementary notes: Basic tar. (line 11) * create, introduced: Creating the archive. @@ -6153,45 +6165,45 @@ Summary::. * create, using with '--verify': verify. (line 24) * delay-directory-restore: Directory Modification Times and Permissions. (line 62) -* delay-directory-restore, summary: Option Summary. (line 180) +* delay-directory-restore, summary: Option Summary. (line 186) * delete: delete. (line 6) * delete, summary: Operation Summary. (line 34) * delete, using before -append: append. (line 47) * dereference: dereference. (line 6) -* dereference, summary: Option Summary. (line 186) +* dereference, summary: Option Summary. (line 192) * diff, summary: Operation Summary. (line 39) * directory: directory. (line 11) -* directory, summary: Option Summary. (line 193) +* directory, summary: Option Summary. (line 199) * exclude: exclude. (line 6) * exclude <1>: exclude. (line 9) * exclude, potential problems with: problems with exclude. (line 6) -* exclude, summary: Option Summary. (line 201) +* exclude, summary: Option Summary. (line 207) * exclude-backups: exclude. (line 114) -* exclude-backups, summary: Option Summary. (line 206) +* exclude-backups, summary: Option Summary. (line 212) * exclude-caches: exclude. (line 134) -* exclude-caches, summary: Option Summary. (line 215) +* exclude-caches, summary: Option Summary. (line 221) * exclude-caches-all: exclude. (line 142) -* exclude-caches-all, summary: Option Summary. (line 230) +* exclude-caches-all, summary: Option Summary. (line 236) * exclude-caches-under: exclude. (line 138) -* exclude-caches-under, summary: Option Summary. (line 223) +* exclude-caches-under, summary: Option Summary. (line 229) * exclude-from: exclude. (line 6) * exclude-from <1>: exclude. (line 20) -* exclude-from, summary: Option Summary. (line 209) +* exclude-from, summary: Option Summary. (line 215) * exclude-ignore: exclude. (line 76) -* exclude-ignore, summary: Option Summary. (line 235) +* exclude-ignore, summary: Option Summary. (line 241) * exclude-ignore-recursive: exclude. (line 81) -* exclude-ignore-recursive, summary: Option Summary. (line 240) +* exclude-ignore-recursive, summary: Option Summary. (line 246) * exclude-tag: exclude. (line 151) -* exclude-tag, summary: Option Summary. (line 245) +* exclude-tag, summary: Option Summary. (line 251) * exclude-tag-all: exclude. (line 159) -* exclude-tag-all, summary: Option Summary. (line 257) +* exclude-tag-all, summary: Option Summary. (line 263) * exclude-tag-under: exclude. (line 155) -* exclude-tag-under, summary: Option Summary. (line 251) +* exclude-tag-under, summary: Option Summary. (line 257) * exclude-vcs: exclude. (line 85) -* exclude-vcs, summary: Option Summary. (line 262) +* exclude-vcs, summary: Option Summary. (line 268) * exclude-vcs-ignores: exclude. (line 42) -* exclude-vcs-ignores, summary: Option Summary. (line 269) +* exclude-vcs-ignores, summary: Option Summary. (line 275) * extract: extract. (line 6) * extract, additional options: extract options. (line 6) * extract, complementary notes: Basic tar. (line 49) @@ -6200,60 +6212,60 @@ Summary::. (line 120) * file: file. (line 6) * file, short description: file. (line 15) -* file, summary: Option Summary. (line 277) +* file, summary: Option Summary. (line 283) * file, tutorial: file tutorial. (line 6) * files-from: files. (line 14) -* files-from, summary: Option Summary. (line 284) +* files-from, summary: Option Summary. (line 290) * force-local, short description: Device. (line 70) -* force-local, summary: Option Summary. (line 291) -* format, summary: Option Summary. (line 297) -* full-time, summary: Option Summary. (line 322) +* force-local, summary: Option Summary. (line 297) +* format, summary: Option Summary. (line 303) +* full-time, summary: Option Summary. (line 328) * get, summary: Operation Summary. (line 50) * group: override. (line 99) -* group, summary: Option Summary. (line 340) -* group-map, summary: Option Summary. (line 350) -* gunzip, summary: Option Summary. (line 360) -* gzip: gzip. (line 91) -* gzip, summary: Option Summary. (line 360) +* group, summary: Option Summary. (line 346) +* group-map, summary: Option Summary. (line 356) +* gunzip, summary: Option Summary. (line 366) +* gzip: gzip. (line 99) +* gzip, summary: Option Summary. (line 366) * hard-dereference, described: hard links. (line 59) -* hard-dereference, summary: Option Summary. (line 369) +* hard-dereference, summary: Option Summary. (line 375) * help: help tutorial. (line 6) * help, introduction: help. (line 26) -* help, summary: Option Summary. (line 375) +* help, summary: Option Summary. (line 381) * hole-detection: sparse. (line 66) -* hole-detection, summary: Option Summary. (line 381) +* hole-detection, summary: Option Summary. (line 387) * ignore-case: controlling pattern-matching. (line 85) -* ignore-case, summary: Option Summary. (line 386) +* ignore-case, summary: Option Summary. (line 392) * ignore-command-error: Writing to an External Program. (line 111) -* ignore-command-error, summary: Option Summary. (line 390) +* ignore-command-error, summary: Option Summary. (line 396) * ignore-failed-read: Ignore Failed Read. (line 7) -* ignore-failed-read, summary: Option Summary. (line 394) +* ignore-failed-read, summary: Option Summary. (line 400) * ignore-zeros: Ignore Zeros. (line 6) * ignore-zeros, short description: Blocking Factor. (line 152) -* ignore-zeros, summary: Option Summary. (line 399) -* incremental, summary: Option Summary. (line 405) +* ignore-zeros, summary: Option Summary. (line 405) +* incremental, summary: Option Summary. (line 411) * incremental, using with '--list': Incremental Dumps. (line 185) -* index-file, summary: Option Summary. (line 413) +* index-file, summary: Option Summary. (line 419) * info-script: Multi-Volume Archives. (line 83) * info-script, short description: Device. (line 121) -* info-script, summary: Option Summary. (line 417) +* info-script, summary: Option Summary. (line 423) * interactive: interactive. (line 14) -* interactive, summary: Option Summary. (line 426) -* keep-directory-symlink, summary: Option Summary. (line 434) +* interactive, summary: Option Summary. (line 432) +* keep-directory-symlink, summary: Option Summary. (line 440) * keep-newer-files: Keep Newer Files. (line 6) -* keep-newer-files, summary: Option Summary. (line 448) +* keep-newer-files, summary: Option Summary. (line 454) * keep-old-files: Keep Old Files. (line 9) * keep-old-files, introduced: Dealing with Old Files. (line 16) -* keep-old-files, summary: Option Summary. (line 453) +* keep-old-files, summary: Option Summary. (line 459) * label: Tape Files. (line 6) * label <1>: label. (line 6) -* label, summary: Option Summary. (line 462) +* label, summary: Option Summary. (line 468) * level, described: Incremental Dumps. (line 75) -* level, summary: Option Summary. (line 470) +* level, summary: Option Summary. (line 476) * list: list. (line 6) * list, summary: Operation Summary. (line 55) * list, using with '--incremental': Incremental Dumps. (line 185) @@ -6262,228 +6274,229 @@ Summary::. * list, using with '--verbose': list. (line 34) * list, using with file name arguments: list. (line 25) * listed-incremental, described: Incremental Dumps. (line 14) -* listed-incremental, summary: Option Summary. (line 480) +* listed-incremental, summary: Option Summary. (line 486) * listed-incremental, using with '--extract': Incremental Dumps. (line 120) * listed-incremental, using with '--list': Incremental Dumps. (line 185) -* lzip: gzip. (line 104) -* lzip, summary: Option Summary. (line 489) -* lzma: gzip. (line 107) -* lzma, summary: Option Summary. (line 494) -* lzop: gzip. (line 110) +* lzip: gzip. (line 112) +* lzip, summary: Option Summary. (line 495) +* lzma: gzip. (line 115) +* lzma, summary: Option Summary. (line 500) +* lzop: gzip. (line 118) * mode: override. (line 14) -* mode, summary: Option Summary. (line 504) +* mode, summary: Option Summary. (line 510) * mtime: override. (line 30) -* mtime, summary: Option Summary. (line 511) +* mtime, summary: Option Summary. (line 517) * multi-volume: Multi-Volume Archives. (line 6) * multi-volume, short description: Device. (line 88) -* multi-volume, summary: Option Summary. (line 526) +* multi-volume, summary: Option Summary. (line 532) * new-volume-script: Multi-Volume Archives. (line 83) * new-volume-script, short description: Device. (line 121) -* new-volume-script, summary: Option Summary. (line 417) -* new-volume-script, summary <1>: Option Summary. (line 532) +* new-volume-script, summary: Option Summary. (line 423) +* new-volume-script, summary <1>: Option Summary. (line 538) * newer: after. (line 24) -* newer, summary: Option Summary. (line 536) +* newer, summary: Option Summary. (line 542) * newer-mtime: after. (line 35) -* newer-mtime, summary: Option Summary. (line 545) -* no-acls, summary: Option Summary. (line 551) +* newer-mtime, summary: Option Summary. (line 551) +* no-acls, summary: Option Summary. (line 557) * no-anchored: controlling pattern-matching. (line 78) -* no-anchored, summary: Option Summary. (line 555) -* no-auto-compress, summary: Option Summary. (line 559) +* no-anchored, summary: Option Summary. (line 561) +* no-auto-compress, summary: Option Summary. (line 565) * no-check-device, described: Incremental Dumps. (line 103) -* no-check-device, summary: Option Summary. (line 564) +* no-check-device, summary: Option Summary. (line 570) * no-delay-directory-restore: Directory Modification Times and Permissions. (line 68) -* no-delay-directory-restore, summary: Option Summary. (line 569) +* no-delay-directory-restore, summary: Option Summary. (line 575) * no-ignore-case: controlling pattern-matching. (line 85) -* no-ignore-case, summary: Option Summary. (line 575) +* no-ignore-case, summary: Option Summary. (line 581) * no-ignore-command-error: Writing to an External Program. (line 116) -* no-ignore-command-error, summary: Option Summary. (line 578) +* no-ignore-command-error, summary: Option Summary. (line 584) * no-null, described: nul. (line 15) -* no-null, summary: Option Summary. (line 582) -* no-overwrite-dir, summary: Option Summary. (line 588) -* no-quote-chars, summary: Option Summary. (line 593) +* no-null, summary: Option Summary. (line 588) +* no-overwrite-dir, summary: Option Summary. (line 594) +* no-quote-chars, summary: Option Summary. (line 599) * no-recursion: recurse. (line 11) -* no-recursion, summary: Option Summary. (line 598) +* no-recursion, summary: Option Summary. (line 604) * no-same-owner: Attributes. (line 63) -* no-same-owner, summary: Option Summary. (line 603) -* no-same-permissions, summary: Option Summary. (line 610) -* no-seek, summary: Option Summary. (line 616) -* no-selinux, summary: Option Summary. (line 622) +* no-same-owner, summary: Option Summary. (line 609) +* no-same-permissions, summary: Option Summary. (line 616) +* no-seek, summary: Option Summary. (line 622) +* no-selinux, summary: Option Summary. (line 628) * no-unquote: Selecting Archive Members. (line 42) -* no-unquote, summary: Option Summary. (line 626) +* no-unquote, summary: Option Summary. (line 632) * no-verbatim-files-from: files. (line 75) -* no-verbatim-files-from, summary: Option Summary. (line 630) +* no-verbatim-files-from, summary: Option Summary. (line 636) * no-wildcards: controlling pattern-matching. (line 41) -* no-wildcards, summary: Option Summary. (line 644) +* no-wildcards, summary: Option Summary. (line 650) * no-wildcards-match-slash: controlling pattern-matching. (line 91) -* no-wildcards-match-slash, summary: Option Summary. (line 647) -* no-xattrs, summary: Option Summary. (line 650) +* no-wildcards-match-slash, summary: Option Summary. (line 653) +* no-xattrs, summary: Option Summary. (line 656) * null, described: nul. (line 11) -* null, summary: Option Summary. (line 654) +* null, summary: Option Summary. (line 660) * numeric-owner: Attributes. (line 69) -* numeric-owner, summary: Option Summary. (line 667) +* numeric-owner, summary: Option Summary. (line 673) * occurrence, described: append. (line 34) -* occurrence, summary: Option Summary. (line 685) -* old-archive, summary: Option Summary. (line 700) +* occurrence, summary: Option Summary. (line 691) +* old-archive, summary: Option Summary. (line 706) * one-file-system: one. (line 14) -* one-file-system, summary: Option Summary. (line 703) -* one-top-level, summary: Option Summary. (line 708) +* one-file-system, summary: Option Summary. (line 709) +* one-top-level, summary: Option Summary. (line 714) * overwrite: Overwrite Old Files. (line 6) * overwrite, introduced: Dealing with Old Files. (line 32) -* overwrite, summary: Option Summary. (line 719) +* overwrite, summary: Option Summary. (line 725) * overwrite-dir: Overwrite Old Files. (line 28) * overwrite-dir, introduced: Dealing with Old Files. (line 6) -* overwrite-dir, summary: Option Summary. (line 724) +* overwrite-dir, summary: Option Summary. (line 730) * owner: override. (line 67) -* owner, summary: Option Summary. (line 729) -* owner-map, summary: Option Summary. (line 739) +* owner, summary: Option Summary. (line 735) +* owner-map, summary: Option Summary. (line 745) * pax-option: PAX keywords. (line 6) -* pax-option, summary: Option Summary. (line 749) -* portability, summary: Option Summary. (line 755) -* posix, summary: Option Summary. (line 759) +* pax-option, summary: Option Summary. (line 755) +* portability, summary: Option Summary. (line 761) +* posix, summary: Option Summary. (line 765) * preserve-order: Same Order. (line 6) -* preserve-order, summary: Option Summary. (line 762) +* preserve-order, summary: Option Summary. (line 768) * preserve-permissions: Setting Access Permissions. (line 10) * preserve-permissions, short description: Attributes. (line 109) -* preserve-permissions, summary: Option Summary. (line 766) -* quote-chars, summary: Option Summary. (line 777) +* preserve-permissions, summary: Option Summary. (line 772) +* quote-chars, summary: Option Summary. (line 783) * quoting-style: quoting styles. (line 36) -* quoting-style, summary: Option Summary. (line 781) +* quoting-style, summary: Option Summary. (line 787) * read-full-records: Reading. (line 6) * read-full-records <1>: read full records. (line 6) * read-full-records, short description: Blocking Factor. (line 168) -* read-full-records, summary: Option Summary. (line 788) -* record-size, summary: Option Summary. (line 794) +* read-full-records, summary: Option Summary. (line 794) +* record-size, summary: Option Summary. (line 800) * recursion: recurse. (line 22) -* recursion, summary: Option Summary. (line 802) +* recursion, summary: Option Summary. (line 808) * recursive-unlink: Recursive Unlink. (line 6) -* recursive-unlink, summary: Option Summary. (line 807) +* recursive-unlink, summary: Option Summary. (line 813) * remove-files: remove files. (line 6) -* remove-files, summary: Option Summary. (line 812) -* restrict, summary: Option Summary. (line 817) -* rmt-command, summary: Option Summary. (line 823) +* remove-files, summary: Option Summary. (line 818) +* restrict, summary: Option Summary. (line 823) +* rmt-command, summary: Option Summary. (line 829) * rsh-command: Device. (line 73) -* rsh-command, summary: Option Summary. (line 828) +* rsh-command, summary: Option Summary. (line 834) * same-order: Same Order. (line 6) -* same-order, summary: Option Summary. (line 833) +* same-order, summary: Option Summary. (line 839) * same-owner: Attributes. (line 44) -* same-owner, summary: Option Summary. (line 842) +* same-owner, summary: Option Summary. (line 848) * same-permissions: Setting Access Permissions. (line 10) * same-permissions, short description: Attributes. (line 109) -* same-permissions, summary: Option Summary. (line 766) -* same-permissions, summary <1>: Option Summary. (line 849) -* seek, summary: Option Summary. (line 853) -* selinux, summary: Option Summary. (line 863) +* same-permissions, summary: Option Summary. (line 772) +* same-permissions, summary <1>: Option Summary. (line 855) +* seek, summary: Option Summary. (line 859) +* selinux, summary: Option Summary. (line 869) * show-defaults: defaults. (line 6) -* show-defaults, summary: Option Summary. (line 867) +* show-defaults, summary: Option Summary. (line 873) * show-omitted-dirs: verbose. (line 105) -* show-omitted-dirs, summary: Option Summary. (line 880) +* show-omitted-dirs, summary: Option Summary. (line 886) * show-snapshot-field-ranges: Snapshot Files. (line 111) -* show-snapshot-field-ranges, summary: Option Summary. (line 885) +* show-snapshot-field-ranges, summary: Option Summary. (line 891) * show-stored-names: list. (line 68) -* show-stored-names, summary: Option Summary. (line 891) +* show-stored-names, summary: Option Summary. (line 897) * show-transformed-names: transform. (line 45) -* show-transformed-names, summary: Option Summary. (line 891) +* show-transformed-names, summary: Option Summary. (line 897) * skip-old-files, introduced: Dealing with Old Files. (line 28) -* skip-old-files, summary: Option Summary. (line 900) -* sort, summary: Option Summary. (line 913) +* skip-old-files, summary: Option Summary. (line 906) +* sort, summary: Option Summary. (line 919) * sparse: sparse. (line 24) -* sparse, summary: Option Summary. (line 930) +* sparse, summary: Option Summary. (line 936) * sparse-version: sparse. (line 59) -* sparse-version, summary: Option Summary. (line 936) +* sparse-version, summary: Option Summary. (line 942) * starting-file: Starting File. (line 6) -* starting-file, summary: Option Summary. (line 942) +* starting-file, summary: Option Summary. (line 948) * strip-components: transform. (line 25) -* strip-components, summary: Option Summary. (line 949) +* strip-components, summary: Option Summary. (line 955) * suffix: backup. (line 67) -* suffix, summary: Option Summary. (line 960) +* suffix, summary: Option Summary. (line 966) * tape-length: Multi-Volume Archives. (line 33) * tape-length, short description: Device. (line 96) -* tape-length, summary: Option Summary. (line 965) +* tape-length, summary: Option Summary. (line 971) * test-label: label. (line 35) -* test-label, summary: Option Summary. (line 975) +* test-label, summary: Option Summary. (line 982) * to-command: Writing to an External Program. (line 9) -* to-command, summary: Option Summary. (line 980) +* to-command, summary: Option Summary. (line 987) * to-stdout: Writing to Standard Output. (line 14) -* to-stdout, summary: Option Summary. (line 985) +* to-stdout, summary: Option Summary. (line 992) * totals: verbose. (line 45) -* totals, summary: Option Summary. (line 991) +* totals, summary: Option Summary. (line 998) * touch: Data Modification Times. (line 15) * touch <1>: Attributes. (line 33) -* touch, summary: Option Summary. (line 997) +* touch, summary: Option Summary. (line 1004) * transform: transform. (line 74) -* transform, summary: Option Summary. (line 1004) -* uncompress: gzip. (line 113) -* uncompress, summary: Option Summary. (line 164) -* uncompress, summary <1>: Option Summary. (line 1018) -* ungzip: gzip. (line 91) -* ungzip, summary: Option Summary. (line 360) -* ungzip, summary <1>: Option Summary. (line 1022) +* transform, summary: Option Summary. (line 1011) +* uncompress: gzip. (line 124) +* uncompress, summary: Option Summary. (line 170) +* uncompress, summary <1>: Option Summary. (line 1025) +* ungzip: gzip. (line 99) +* ungzip, summary: Option Summary. (line 366) +* ungzip, summary <1>: Option Summary. (line 1029) * unlink-first: Unlink First. (line 6) * unlink-first, introduced: Dealing with Old Files. (line 51) -* unlink-first, summary: Option Summary. (line 1026) +* unlink-first, summary: Option Summary. (line 1033) * unquote: Selecting Archive Members. (line 39) -* unquote, summary: Option Summary. (line 1032) +* unquote, summary: Option Summary. (line 1039) * update: update. (line 6) * update <1>: how to update. (line 6) * update, summary: Operation Summary. (line 60) * usage: help. (line 53) -* use-compress-program: gzip. (line 172) -* use-compress-program, summary: Option Summary. (line 1036) -* utc, summary: Option Summary. (line 1042) +* use-compress-program: gzip. (line 185) +* use-compress-program, summary: Option Summary. (line 1043) +* utc, summary: Option Summary. (line 1049) * verbatim-files-from: files. (line 70) -* verbatim-files-from, summary: Option Summary. (line 1047) +* verbatim-files-from, summary: Option Summary. (line 1054) * verbose: verbose. (line 18) * verbose, introduced: verbose tutorial. (line 6) -* verbose, summary: Option Summary. (line 1069) +* verbose, summary: Option Summary. (line 1076) * verbose, using with '--create': create verbose. (line 6) * verbose, using with '--list': list. (line 34) * verify, short description: verify. (line 8) -* verify, summary: Option Summary. (line 1077) +* verify, summary: Option Summary. (line 1084) * verify, using with '--create': verify. (line 24) * version: help. (line 6) -* version, summary: Option Summary. (line 1083) +* version, summary: Option Summary. (line 1090) * volno-file: Multi-Volume Archives. (line 74) -* volno-file, summary: Option Summary. (line 1089) +* volno-file, summary: Option Summary. (line 1096) * warning, explained: warnings. (line 12) -* warning, summary: Option Summary. (line 1095) +* warning, summary: Option Summary. (line 1102) * wildcards: controlling pattern-matching. (line 38) -* wildcards, summary: Option Summary. (line 1101) +* wildcards, summary: Option Summary. (line 1108) * wildcards-match-slash: controlling pattern-matching. (line 91) -* wildcards-match-slash, summary: Option Summary. (line 1105) -* xattrs, summary: Option Summary. (line 1108) -* xattrs-exclude, summary: Option Summary. (line 1112) -* xattrs-include, summary: Option Summary. (line 1116) +* wildcards-match-slash, summary: Option Summary. (line 1112) +* xattrs, summary: Option Summary. (line 1115) +* xattrs-exclude, summary: Option Summary. (line 1119) +* xattrs-include, summary: Option Summary. (line 1123) * xform: transform. (line 74) -* xform, summary: Option Summary. (line 1004) -* xz: gzip. (line 96) -* xz, summary: Option Summary. (line 1122) +* xform, summary: Option Summary. (line 1011) +* xz: gzip. (line 104) +* xz, summary: Option Summary. (line 1129) +* zstd: gzip. (line 121)  File: tar.info, Node: Index, Prev: Index of Command Line Options, Up: Top @@ -6522,7 +6535,7 @@ Appendix J Index (line 23) * all: warnings. (line 28) * alone-zero-block: warnings. (line 33) -* alternative decompression programs: gzip. (line 54) +* alternative decompression programs: gzip. (line 62) * am in date strings: Time of day items. (line 21) * Appending files to an Archive: appending files. (line 6) * appending files to existing archive: append. (line 6) @@ -6600,7 +6613,7 @@ Appendix J Index (line 40) * contiguous-cast: warnings. (line 70) * corrupted archives: Full Dumps. (line 8) -* corrupted archives <1>: gzip. (line 140) +* corrupted archives <1>: gzip. (line 151) * Creation of the archive: create. (line 6) * 'Current %s is newer or same age', warning message: warnings. (line 76) @@ -6670,7 +6683,7 @@ Appendix J Index * Excluding files by file system: exclude. (line 6) * Excluding files by name and pattern: exclude. (line 6) * Exec Mode, 'genfile': Exec Mode. (line 6) -* 'exec', checkpoint action: checkpoints. (line 151) +* 'exec', checkpoint action: checkpoints. (line 166) * existing backup method: backup. (line 59) * existing-file: warnings. (line 66) * exit status: Synopsis. (line 67) @@ -6750,8 +6763,8 @@ Appendix J Index * GNU.sparse.offset, extended header variable: PAX 0. (line 17) * GNU.sparse.realsize, extended header variable: PAX 1. (line 24) * GNU.sparse.size, extended header variable: PAX 0. (line 10) -* gnupg, using with tar: gzip. (line 196) -* gpg, using with tar: gzip. (line 196) +* gnupg, using with tar: gzip. (line 209) +* gpg, using with tar: gzip. (line 209) * gzip: gzip. (line 6) * hard links, dereferencing: hard links. (line 6) * header-col: Configuring Help Summary. @@ -6875,7 +6888,7 @@ Appendix J Index (line 127) * option syntax, traditional: Old Options. (line 6) * optional arguments to long options: Long Options. (line 39) -* optional arguments to short options: Short Options. (line 21) +* optional arguments to short options: Short Options. (line 22) * options for use with '--extract': extract options. (line 6) * Options when reading archives: Reading. (line 6) * Options, archive format specifying: Format Variations. (line 6) @@ -6939,7 +6952,7 @@ Appendix J Index * SCCS, excluding files: exclude. (line 85) * short options: Short Options. (line 6) * short options with mandatory arguments: Short Options. (line 13) -* short options with optional arguments: Short Options. (line 21) +* short options with optional arguments: Short Options. (line 22) * short-opt-col: Configuring Help Summary. (line 79) * simple backup method: backup. (line 64) @@ -7006,7 +7019,7 @@ Appendix J Index * tar-snapshot-edit: Fixing Snapshot Files. (line 17) * tarcat: Tarcat. (line 6) -* TAR_ARCHIVE, checkpoint script environment: checkpoints. (line 167) +* TAR_ARCHIVE, checkpoint script environment: checkpoints. (line 182) * TAR_ARCHIVE, info script environment variable: Multi-Volume Archives. (line 105) * TAR_ARCHIVE, to-command environment: Writing to an External Program. @@ -7014,12 +7027,12 @@ Appendix J Index * TAR_ATIME, to-command environment: Writing to an External Program. (line 52) * TAR_BLOCKING_FACTOR, checkpoint script environment: checkpoints. - (line 170) + (line 185) * TAR_BLOCKING_FACTOR, info script environment variable: Multi-Volume Archives. (line 108) * TAR_BLOCKING_FACTOR, to-command environment: Writing to an External Program. (line 82) -* TAR_CHECKPOINT, checkpoint script environment: checkpoints. (line 173) +* TAR_CHECKPOINT, checkpoint script environment: checkpoints. (line 188) * TAR_CTIME, to-command environment: Writing to an External Program. (line 61) * TAR_FD, info script environment variable: Multi-Volume Archives. @@ -7028,7 +7041,7 @@ Appendix J Index (line 40) * TAR_FILETYPE, to-command environment: Writing to an External Program. (line 24) -* TAR_FORMAT, checkpoint script environment: checkpoints. (line 180) +* TAR_FORMAT, checkpoint script environment: checkpoints. (line 195) * TAR_FORMAT, info script environment variable: Multi-Volume Archives. (line 118) * TAR_FORMAT, to-command environment: Writing to an External Program. @@ -7046,14 +7059,14 @@ Appendix J Index (line 43) * TAR_SIZE, to-command environment: Writing to an External Program. (line 64) -* TAR_SUBCOMMAND, checkpoint script environment: checkpoints. (line 176) +* TAR_SUBCOMMAND, checkpoint script environment: checkpoints. (line 191) * TAR_SUBCOMMAND, info script environment variable: Multi-Volume Archives. (line 114) * TAR_UID, to-command environment: Writing to an External Program. (line 67) * TAR_UNAME, to-command environment: Writing to an External Program. (line 46) -* TAR_VERSION, checkpoint script environment: checkpoints. (line 164) +* TAR_VERSION, checkpoint script environment: checkpoints. (line 179) * TAR_VERSION, info script environment variable: Multi-Volume Archives. (line 102) * TAR_VERSION, to-command environment: Writing to an External Program. @@ -7090,7 +7103,7 @@ Appendix J Index * Updating an archive: update. (line 6) * usage-indent: Configuring Help Summary. (line 155) -* Using encrypted archives: gzip. (line 196) +* Using encrypted archives: gzip. (line 209) * ustar archive format: ustar. (line 6) * v7 archive format: old. (line 6) * VCS, excluding files: exclude. (line 85) @@ -7110,6 +7123,7 @@ Appendix J Index * Volume label, listing: label. (line 27) * Volume number file: Multi-Volume Archives. (line 74) +* 'wait', checkpoint action: checkpoints. (line 151) * week in date strings: Relative items in date strings. (line 15) * Where is the archive?: file. (line 6) @@ -7126,4 +7140,5 @@ Appendix J Index (line 15) * yesterday in date strings: Relative items in date strings. (line 29) +* zstd: gzip. (line 6) diff --git a/doc/tar.texi b/doc/tar.texi index ce8508f523a8e62e0ef8f3b3b592d7c6b64f2871..71318f3e0fc67feb1a0ac24bde6640f2f89c685b 100644 --- a/doc/tar.texi +++ b/doc/tar.texi @@ -1464,7 +1464,7 @@ tar: Removing leading '/' from member names /home/myself/practice/folk /home/myself/practice/jazz /home/myself/practice/collection.tar -$ @kbd{tar --test --file practice.tar} +$ @kbd{tar --list --file practice.tar} home/myself/practice/ home/myself/practice/blues home/myself/practice/folk @@ -1495,7 +1495,7 @@ home/myself/practice/blues home/myself/practice/folk home/myself/practice/jazz home/myself/practice/collection.tar -$ @kbd{tar --test --file practice.tar} +$ @kbd{tar --list --file practice.tar} home/myself/practice/ home/myself/practice/blues home/myself/practice/folk @@ -2553,6 +2553,12 @@ Wait for @var{time} seconds. @item ttyout=@var{string} Output @var{string} on the current console (@file{/dev/tty}). + +@item totals +Print statistics (see @pxref{totals}). + +@item wait=@var{signo} +Wait for signal @var{signo}. @end table Several @option{--checkpoint-action} options can be specified. The @@ -3713,6 +3719,9 @@ only attributes from the user namespace. @itemx -J Use @command{xz} for compressing or decompressing the archives. @xref{gzip}. +@item --zstd +Use @command{zstd} for compressing or decompressing the archives. @xref{gzip}. + @end table @node Short Option Summary @@ -3786,8 +3795,8 @@ them with the equivalent long option. @item -m @tab @ref{--touch}. -@item -o @tab When creating, @ref{--no-same-owner}, when extracting --- -@ref{--portability}. +@item -o @tab When extracting, same as @ref{--no-same-owner}. When creating, +-- @ref{--old-archive}. The latter usage is deprecated. It is retained for compatibility with the earlier versions of @GNUTAR{}. In future releases @@ -3968,7 +3977,7 @@ successfully. For example, @w{@samp{tar --version}} might print: @smallexample tar (GNU tar) @value{VERSION} -Copyright (C) 2013-2017 Free Software Foundation, Inc. +Copyright (C) 2013-2019 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. @@ -4449,6 +4458,25 @@ checkpoint: $ @kbd{tar -c --checkpoint=1000 --checkpoint-action=sleep=30} @end smallexample +@anchor{checkpoint wait} +@cindex @code{wait}, checkpoint action +The @code{wait=@var{signo}} action stops further execution until the +signal @var{signo} is delivered. Valid values for @var{signo} are: +@code{SIGHUP}, @code{SIGQUIT}, @code{SIGINT}, @code{SIGUSR1} and +@code{SIGUSR2}. The @samp{SIG} prefix is optional. For example: + +@example +$ @kbd{tar -c -f arc --checkpoint=1000 --checkpoint-action wait=USR1 .} +@end example + +In this example, @GNUTAR{} will stop archivation at each 1000th +checkpoint. wait until the @samp{SIGUSR1} signal is delivered, +and resume processing. + +This action is used by the @command{genfile} utility to perform +modifications on the input files upon hitting certain checkpoints +(@pxref{Exec Mode, genfile}). + @anchor{checkpoint exec} @cindex @code{exec}, checkpoint action Finally, the @code{exec} action executes a given external command. @@ -5477,7 +5505,7 @@ reproducible archives given a common timestamp for generated files while still retaining the original timestamps of untouched files. @smallexample -$ @kbd{tar -c -f archive.tar --clamp-mtime --mtime=@atchar{}$SOURCE_DATE_EPOCH .} +$ @kbd{tar -c -f archive.tar --clamp-mtime --mtime=@@$SOURCE_DATE_EPOCH .} @end smallexample @item --owner=@var{user} @@ -9520,24 +9548,32 @@ switch to @samp{posix}. @cindex lzma @cindex lzop @cindex compress +@cindex zstd @GNUTAR{} is able to create and read compressed archives. It supports a wide variety of compression programs, namely: @command{gzip}, @command{bzip2}, @command{lzip}, @command{lzma}, @command{lzop}, -@command{xz} and traditional @command{compress}. The latter is -supported mostly for backward compatibility, and we recommend +@command{zstd}, @command{xz} and traditional @command{compress}. The +latter is supported mostly for backward compatibility, and we recommend against using it, because it is by far less effective than the other compression programs@footnote{It also had patent problems in the past.}. Creating a compressed archive is simple: you just specify a @dfn{compression option} along with the usual archive creation -commands. The compression option is @option{-z} (@option{--gzip}) to -create a @command{gzip} compressed archive, @option{-j} -(@option{--bzip2}) to create a @command{bzip2} compressed archive, -@option{--lzip} to create an @asis{lzip} compressed archive, -@option{-J} (@option{--xz}) to create an @asis{XZ} archive, -@option{--lzma} to create an @asis{LZMA} compressed -archive, @option{--lzop} to create an @asis{LZOP} archive, and -@option{-Z} (@option{--compress}) to use @command{compress} program. +commands. Available compression options are summarized in the +table below: + +@multitable @columnfractions 0.4 0.2 0.4 +@headitem Long @tab Short @tab Archive format +@item @option{--gzip} @tab @option{-z} @tab @command{gzip} +@item @option{--bzip2} @tab @option{-j} @tab @command{bzip2} +@item @option{--xz} @tab @option{-J} @tab @command{xz} +@item @option{--lzip} @tab @tab @command{lzip} +@item @option{--lzma} @tab @tab @command{lzma} +@item @option{--lzop} @tab @tab @command{lzop} +@item @option{--zstd} @tab @tab @command{zstd} +@item @option{--compress} @tab @option{-Z} @tab @command{compress} +@end multitable + For example: @smallexample @@ -9658,6 +9694,10 @@ Filter the archive through @command{lzma}. @item --lzop Filter the archive through @command{lzop}. +@opindex zstd +@item --zstd +Filter the archive through @command{zstd}. + @opindex compress @opindex uncompress @item -Z @@ -9730,6 +9770,8 @@ suffix. The following suffixes are recognized: @item @samp{.tlz} @tab @command{lzma} @item @samp{.lzo} @tab @command{lzop} @item @samp{.xz} @tab @command{xz} +@item @samp{.zst} @tab @command{zstd} +@item @samp{.tzst} @tab @command{zstd} @end multitable @anchor{use-compress-program} diff --git a/doc/texify.sed b/doc/texify.sed index f48f2051c3f87baedd31535fc4cd7d495e4c9683..b67c018c62b5c0de0097b2732d065e75770c4e5b 100644 --- a/doc/texify.sed +++ b/doc/texify.sed @@ -1,5 +1,4 @@ -# Copyright 2006-2007, 2013-2014, 2016-2017 Free Software Foundation, -# Inc. +# Copyright 2006-2019 Free Software Foundation, Inc. # This file is part of GNU tar. diff --git a/doc/value.texi b/doc/value.texi index 790b199974af4d04292381a77999c5902302a1fe..b2e14485e2c8f7232c6829f9b760147b5a57188f 100644 --- a/doc/value.texi +++ b/doc/value.texi @@ -1,6 +1,5 @@ @c This is part of GNU tar manual. -@c Copyright 1992, 1994-1997, 1999-2006, 2013-2014, 2016-2017 Free -@c Software Foundation, Inc. +@c Copyright 1992-2019 Free Software Foundation, Inc. @c See file tar.texi for copying conditions. @macro GNUTAR diff --git a/doc/version.texi b/doc/version.texi index 0b31161260877adab32e60fcc7cdde186a85e365..1b3ab5e46fbc1e33f3491e319275ba14f36d8f4d 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 16 December 2017 -@set UPDATED-MONTH December 2017 -@set EDITION 1.30 -@set VERSION 1.30 +@set UPDATED 4 February 2019 +@set UPDATED-MONTH February 2019 +@set EDITION 1.32 +@set VERSION 1.32 diff --git a/gnu/Makefile.am b/gnu/Makefile.am index 276b528e7c3592d43c89ffd4dac92c9d15adedb4..acbf88d3c49f817db0b8ea030316db40ff342718 100644 --- a/gnu/Makefile.am +++ b/gnu/Makefile.am @@ -1,6 +1,6 @@ ## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2002-2017 Free Software Foundation, Inc. +# Copyright (C) 2002-2019 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,9 +21,105 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --local-dir=gl --lib=libgnu --source-base=gnu --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=lock --no-conditional-dependencies --no-libtool --macro-prefix=gl alloca areadlinkat-with-size argmatch argp argp-version-etc backupfile closeout configmake dirname error exclude exitfail extern-inline faccessat fchmodat fchownat fcntl-h fdopendir fdutimensat file-has-acl fileblocks fnmatch-gnu fprintftime fseeko fstatat full-write futimens getline getopt-gnu getpagesize gettext gettime gitlog-to-changelog hash human inttostr inttypes lchown linkat localcharset manywarnings mkdirat mkdtemp mkfifoat modechange obstack openat parse-datetime priv-set progname quote quotearg readlinkat renameat root-uid rpmatch safe-read savedir selinux-at setenv snprintf stat-time stdbool stdint stpcpy strdup-posix strerror strtoimax strtol strtoul strtoumax symlinkat timespec timespec-sub unlinkat unlinkdir unlocked-io utimensat version-etc-fsf xalloc xalloc-die xgetcwd xstrtoumax xvasprintf - -AUTOMAKE_OPTIONS = 1.9.6 gnits subdir-objects +# Reproduce by: +# gnulib-tool --import --local-dir=gl \ +# --lib=libgnu \ +# --source-base=gnu \ +# --m4-base=m4 \ +# --doc-base=doc \ +# --tests-base=tests \ +# --aux-dir=build-aux \ +# --no-conditional-dependencies \ +# --no-libtool \ +# --macro-prefix=gl \ +# --avoid=lock \ +# alloca \ +# areadlinkat-with-size \ +# argmatch \ +# argp \ +# argp-version-etc \ +# backupfile \ +# closeout \ +# configmake \ +# dirname \ +# error \ +# exclude \ +# exitfail \ +# extern-inline \ +# faccessat \ +# fchmodat \ +# fchownat \ +# fcntl-h \ +# fdopendir \ +# fdutimensat \ +# file-has-acl \ +# fileblocks \ +# fnmatch-gnu \ +# fprintftime \ +# fseeko \ +# fstatat \ +# full-write \ +# futimens \ +# getline \ +# getopt-gnu \ +# getpagesize \ +# gettext \ +# gettime \ +# gitlog-to-changelog \ +# hash \ +# human \ +# inttostr \ +# inttypes \ +# lchown \ +# linkat \ +# localcharset \ +# manywarnings \ +# mkdirat \ +# mkdtemp \ +# mkfifoat \ +# modechange \ +# obstack \ +# openat \ +# parse-datetime \ +# priv-set \ +# progname \ +# quote \ +# quotearg \ +# readlinkat \ +# renameat \ +# root-uid \ +# rpmatch \ +# safe-read \ +# savedir \ +# selinux-at \ +# setenv \ +# snprintf \ +# stat-time \ +# stdbool \ +# stdint \ +# stpcpy \ +# strdup-posix \ +# strerror \ +# strnlen \ +# strtoimax \ +# strtol \ +# strtoul \ +# strtoumax \ +# symlinkat \ +# timespec \ +# timespec-sub \ +# unlinkat \ +# unlinkdir \ +# unlocked-io \ +# utimensat \ +# version-etc-fsf \ +# xalloc \ +# xalloc-die \ +# xgetcwd \ +# xstrtoumax \ +# xvasprintf + +AUTOMAKE_OPTIONS = 1.11 gnits subdir-objects SUBDIRS = noinst_HEADERS = @@ -611,6 +707,14 @@ EXTRA_DIST += fcntl.in.h ## end gnulib module fcntl-h +## begin gnulib module fcntl-safer + +libgnu_a_SOURCES += creat-safer.c open-safer.c + +EXTRA_DIST += fcntl--.h fcntl-safer.h + +## end gnulib module fcntl-safer + ## begin gnulib module fd-hook libgnu_a_SOURCES += fd-hook.c @@ -712,29 +816,46 @@ EXTRA_libgnu_a_SOURCES += float.c itold.c ## begin gnulib module fnmatch + +EXTRA_DIST += fnmatch.c fnmatch_loop.c + +EXTRA_libgnu_a_SOURCES += fnmatch.c fnmatch_loop.c + +## end gnulib module fnmatch + +## begin gnulib module fnmatch-h + BUILT_SOURCES += $(FNMATCH_H) -# We need the following in order to create when the system -# doesn't have one that supports the required API. +# We need the following in order to create . if GL_GENERATE_FNMATCH_H -fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) +fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_FNMATCH_H''@|$(HAVE_FNMATCH_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_FNMATCH_H''@|$(NEXT_FNMATCH_H)|g' \ + -e 's/@''GNULIB_FNMATCH''@/$(GNULIB_FNMATCH)/g' \ + -e 's|@''HAVE_FNMATCH''@|$(HAVE_FNMATCH)|g' \ + -e 's|@''REPLACE_FNMATCH''@|$(REPLACE_FNMATCH)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ < $(srcdir)/fnmatch.in.h; \ } > $@-t && \ - mv -f $@-t $@ + mv $@-t $@ else fnmatch.h: $(top_builddir)/config.status rm -f $@ endif MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t -EXTRA_DIST += fnmatch.c fnmatch.in.h fnmatch_loop.c - -EXTRA_libgnu_a_SOURCES += fnmatch.c fnmatch_loop.c +EXTRA_DIST += fnmatch.in.h -## end gnulib module fnmatch +## end gnulib module fnmatch-h ## begin gnulib module fpending @@ -864,7 +985,7 @@ BUILT_SOURCES += $(GETOPT_H) $(GETOPT_CDEFS_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. -getopt.h: getopt.in.h $(top_builddir)/config.status +getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ @@ -1038,6 +1159,7 @@ inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \ -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ + -e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \ -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \ -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \ -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \ @@ -1083,6 +1205,7 @@ langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U -e 's/@''GNULIB_NL_LANGINFO''@/$(GNULIB_NL_LANGINFO)/g' \ -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \ -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \ + -e 's|@''HAVE_LANGINFO_ALTMON''@|$(HAVE_LANGINFO_ALTMON)|g' \ -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \ -e 's|@''HAVE_LANGINFO_YESEXPR''@|$(HAVE_LANGINFO_YESEXPR)|g' \ -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \ @@ -1107,6 +1230,13 @@ EXTRA_libgnu_a_SOURCES += lchown.c ## end gnulib module lchown +## begin gnulib module libc-config + + +EXTRA_DIST += cdefs.h libc-config.h + +## end gnulib module libc-config + ## begin gnulib module limits-h BUILT_SOURCES += $(LIMITS_H) @@ -1155,75 +1285,9 @@ EXTRA_libgnu_a_SOURCES += at-func2.c linkat.c ## begin gnulib module localcharset -libgnu_a_SOURCES += localcharset.h localcharset.c - -# We need the following in order to install a simple file in $(libdir) -# which is shared with other installed packages. We use a list of referencing -# packages so that "make uninstall" will remove the file if and only if it -# is not used by another installed package. -# On systems with glibc-2.1 or newer, the file is redundant, therefore we -# avoid installing it. - -all-local: charset.alias ref-add.sed ref-del.sed - -charset_alias = $(DESTDIR)$(libdir)/charset.alias -charset_tmp = $(DESTDIR)$(libdir)/charset.tmp -install-exec-local: install-exec-localcharset -install-exec-localcharset: all-local - if test $(GLIBC21) = no; then \ - case '$(host_os)' in \ - darwin[56]*) \ - need_charset_alias=true ;; \ - darwin* | cygwin* | mingw* | pw32* | cegcc*) \ - need_charset_alias=false ;; \ - *) \ - need_charset_alias=true ;; \ - esac ; \ - else \ - need_charset_alias=false ; \ - fi ; \ - if $$need_charset_alias; then \ - $(mkinstalldirs) $(DESTDIR)$(libdir) ; \ - fi ; \ - if test -f $(charset_alias); then \ - sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \ - $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ - rm -f $(charset_tmp) ; \ - else \ - if $$need_charset_alias; then \ - sed -f ref-add.sed charset.alias > $(charset_tmp) ; \ - $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ - rm -f $(charset_tmp) ; \ - fi ; \ - fi - -uninstall-local: uninstall-localcharset -uninstall-localcharset: all-local - if test -f $(charset_alias); then \ - sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \ - if grep '^# Packages using this file: $$' $(charset_tmp) \ - > /dev/null; then \ - rm -f $(charset_alias); \ - else \ - $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \ - fi; \ - rm -f $(charset_tmp); \ - fi - -charset.alias: config.charset - $(AM_V_GEN)rm -f t-$@ $@ && \ - $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \ - mv t-$@ $@ +libgnu_a_SOURCES += localcharset.c -SUFFIXES += .sed .sin -.sin.sed: - $(AM_V_GEN)rm -f t-$@ $@ && \ - sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \ - mv t-$@ $@ - -CLEANFILES += charset.alias ref-add.sed ref-del.sed - -EXTRA_DIST += config.charset ref-add.sin ref-del.sin +EXTRA_DIST += localcharset.h ## end gnulib module localcharset @@ -1244,11 +1308,16 @@ locale.h: locale.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's/@''GNULIB_LOCALECONV''@/$(GNULIB_LOCALECONV)/g' \ -e 's/@''GNULIB_SETLOCALE''@/$(GNULIB_SETLOCALE)/g' \ -e 's/@''GNULIB_DUPLOCALE''@/$(GNULIB_DUPLOCALE)/g' \ + -e 's/@''GNULIB_LOCALENAME''@/$(GNULIB_LOCALENAME)/g' \ + -e 's|@''HAVE_NEWLOCALE''@|$(HAVE_NEWLOCALE)|g' \ -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|g' \ + -e 's|@''HAVE_FREELOCALE''@|$(HAVE_FREELOCALE)|g' \ -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \ -e 's|@''REPLACE_LOCALECONV''@|$(REPLACE_LOCALECONV)|g' \ -e 's|@''REPLACE_SETLOCALE''@|$(REPLACE_SETLOCALE)|g' \ + -e 's|@''REPLACE_NEWLOCALE''@|$(REPLACE_NEWLOCALE)|g' \ -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \ + -e 's|@''REPLACE_FREELOCALE''@|$(REPLACE_FREELOCALE)|g' \ -e 's|@''REPLACE_STRUCT_LCONV''@|$(REPLACE_STRUCT_LCONV)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ @@ -1320,7 +1389,7 @@ EXTRA_libgnu_a_SOURCES += malloc.c libgnu_a_SOURCES += malloca.c -EXTRA_DIST += malloca.h malloca.valgrind +EXTRA_DIST += malloca.h ## end gnulib module malloca @@ -1568,6 +1637,14 @@ EXTRA_DIST += openat.h ## end gnulib module openat-h +## begin gnulib module openat-safer + +libgnu_a_SOURCES += openat-safer.c + +EXTRA_DIST += fcntl--.h fcntl-safer.h + +## end gnulib module openat-safer + ## begin gnulib module opendir @@ -1577,6 +1654,14 @@ EXTRA_libgnu_a_SOURCES += opendir.c ## end gnulib module opendir +## begin gnulib module opendirat + +libgnu_a_SOURCES += opendirat.c + +EXTRA_DIST += opendirat.h + +## end gnulib module opendirat + ## begin gnulib module parse-datetime # This rule overrides the Automake generated .y.c rule, to ensure that the @@ -1728,15 +1813,15 @@ EXTRA_libgnu_a_SOURCES += renameat.c ## end gnulib module renameat -## begin gnulib module renameat2 +## begin gnulib module renameatu -libgnu_a_SOURCES += renameat2.c +libgnu_a_SOURCES += renameatu.c -EXTRA_DIST += at-func2.c renameat2.h +EXTRA_DIST += at-func2.c renameatu.h EXTRA_libgnu_a_SOURCES += at-func2.c -## end gnulib module renameat2 +## end gnulib module renameatu ## begin gnulib module rewinddir @@ -1776,7 +1861,7 @@ EXTRA_libgnu_a_SOURCES += rpmatch.c libgnu_a_SOURCES += safe-read.c -EXTRA_DIST += safe-read.h +EXTRA_DIST += safe-read.h sys-limits.h ## end gnulib module safe-read @@ -1784,7 +1869,7 @@ EXTRA_DIST += safe-read.h libgnu_a_SOURCES += safe-write.c -EXTRA_DIST += safe-read.c safe-write.h +EXTRA_DIST += safe-read.c safe-write.h sys-limits.h EXTRA_libgnu_a_SOURCES += safe-read.c @@ -1890,8 +1975,8 @@ signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \ - -e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \ - -e 's|@''GNULIB_RAISE''@|$(GNULIB_RAISE)|g' \ + -e 's/@''GNULIB_PTHREAD_SIGMASK''@/$(GNULIB_PTHREAD_SIGMASK)/g' \ + -e 's/@''GNULIB_RAISE''@/$(GNULIB_RAISE)/g' \ -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \ -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \ -e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \ @@ -2605,7 +2690,7 @@ strings.h: strings.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \ - -e 's|@''GNULIB_FFS''@|$(GNULIB_FFS)|g' \ + -e 's/@''GNULIB_FFS''@/$(GNULIB_FFS)/g' \ -e 's|@''HAVE_FFS''@|$(HAVE_FFS)|g' \ -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \ -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \ @@ -3022,6 +3107,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \ -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \ -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \ + -e 's/@''GNULIB_GETPASS''@/$(GNULIB_GETPASS)/g' \ -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \ -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \ -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \ @@ -3065,6 +3151,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GETPASS''@|$(HAVE_GETPASS)|g' \ -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ @@ -3079,7 +3166,6 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \ -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \ - -e 's|@''HAVE_TRUNCATE''@|$(HAVE_TRUNCATE)|g' \ -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ @@ -3091,6 +3177,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \ + -e 's|@''HAVE_DECL_TRUNCATE''@|$(HAVE_DECL_TRUNCATE)|g' \ -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \ -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ @@ -3108,6 +3195,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \ -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \ -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ + -e 's|@''REPLACE_GETPASS''@|$(REPLACE_GETPASS)|g' \ -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \ -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \ @@ -3249,7 +3337,7 @@ BUILT_SOURCES += $(UTIME_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. if GL_GENERATE_UTIME_H -utime.h: utime.in.h $(top_builddir)/config.status +utime.h: utime.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ diff --git a/gnu/Makefile.in b/gnu/Makefile.in index 28471b7ea986c76f5f9ba6e42bee02f3037244f3..7668e95d9750d7d828f82b2f16bdb0e075689003 100644 --- a/gnu/Makefile.in +++ b/gnu/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (C) 2002-2017 Free Software Foundation, Inc. +# Copyright (C) 2002-2019 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -35,12 +35,118 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --local-dir=gl --lib=libgnu --source-base=gnu --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=lock --no-conditional-dependencies --no-libtool --macro-prefix=gl alloca areadlinkat-with-size argmatch argp argp-version-etc backupfile closeout configmake dirname error exclude exitfail extern-inline faccessat fchmodat fchownat fcntl-h fdopendir fdutimensat file-has-acl fileblocks fnmatch-gnu fprintftime fseeko fstatat full-write futimens getline getopt-gnu getpagesize gettext gettime gitlog-to-changelog hash human inttostr inttypes lchown linkat localcharset manywarnings mkdirat mkdtemp mkfifoat modechange obstack openat parse-datetime priv-set progname quote quotearg readlinkat renameat root-uid rpmatch safe-read savedir selinux-at setenv snprintf stat-time stdbool stdint stpcpy strdup-posix strerror strtoimax strtol strtoul strtoumax symlinkat timespec timespec-sub unlinkat unlinkdir unlocked-io utimensat version-etc-fsf xalloc xalloc-die xgetcwd xstrtoumax xvasprintf +# Reproduce by: +# gnulib-tool --import --local-dir=gl \ +# --lib=libgnu \ +# --source-base=gnu \ +# --m4-base=m4 \ +# --doc-base=doc \ +# --tests-base=tests \ +# --aux-dir=build-aux \ +# --no-conditional-dependencies \ +# --no-libtool \ +# --macro-prefix=gl \ +# --avoid=lock \ +# alloca \ +# areadlinkat-with-size \ +# argmatch \ +# argp \ +# argp-version-etc \ +# backupfile \ +# closeout \ +# configmake \ +# dirname \ +# error \ +# exclude \ +# exitfail \ +# extern-inline \ +# faccessat \ +# fchmodat \ +# fchownat \ +# fcntl-h \ +# fdopendir \ +# fdutimensat \ +# file-has-acl \ +# fileblocks \ +# fnmatch-gnu \ +# fprintftime \ +# fseeko \ +# fstatat \ +# full-write \ +# futimens \ +# getline \ +# getopt-gnu \ +# getpagesize \ +# gettext \ +# gettime \ +# gitlog-to-changelog \ +# hash \ +# human \ +# inttostr \ +# inttypes \ +# lchown \ +# linkat \ +# localcharset \ +# manywarnings \ +# mkdirat \ +# mkdtemp \ +# mkfifoat \ +# modechange \ +# obstack \ +# openat \ +# parse-datetime \ +# priv-set \ +# progname \ +# quote \ +# quotearg \ +# readlinkat \ +# renameat \ +# root-uid \ +# rpmatch \ +# safe-read \ +# savedir \ +# selinux-at \ +# setenv \ +# snprintf \ +# stat-time \ +# stdbool \ +# stdint \ +# stpcpy \ +# strdup-posix \ +# strerror \ +# strnlen \ +# strtoimax \ +# strtol \ +# strtoul \ +# strtoumax \ +# symlinkat \ +# timespec \ +# timespec-sub \ +# unlinkat \ +# unlinkdir \ +# unlocked-io \ +# utimensat \ +# version-etc-fsf \ +# xalloc \ +# xalloc-die \ +# xgetcwd \ +# xstrtoumax \ +# xvasprintf VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -104,14 +210,11 @@ build_triplet = @build@ host_triplet = @host@ @LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE@am__append_1 = uniwidth/width.c subdir = gnu -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am alloca.c \ - parse-datetime.c $(top_srcdir)/build-aux/depcomp \ - $(top_srcdir)/build-aux/ylwrap $(noinst_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ + $(top_srcdir)/m4/__inline.m4 \ $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/acl.m4 \ $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/argp.m4 \ - $(top_srcdir)/m4/asm-underscore.m4 \ $(top_srcdir)/m4/backupfile.m4 $(top_srcdir)/m4/bison.m4 \ $(top_srcdir)/m4/btowc.m4 $(top_srcdir)/m4/builtin-expect.m4 \ $(top_srcdir)/m4/canonicalize.m4 \ @@ -131,11 +234,12 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/extern-inline.m4 \ $(top_srcdir)/m4/faccessat.m4 $(top_srcdir)/m4/fchdir.m4 \ $(top_srcdir)/m4/fchmodat.m4 $(top_srcdir)/m4/fchownat.m4 \ - $(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/fcntl.m4 \ - $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fdopendir.m4 \ - $(top_srcdir)/m4/fileblocks.m4 $(top_srcdir)/m4/filenamecat.m4 \ - $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \ - $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpending.m4 \ + $(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/fcntl-safer.m4 \ + $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fdopendir.m4 $(top_srcdir)/m4/fileblocks.m4 \ + $(top_srcdir)/m4/filenamecat.m4 $(top_srcdir)/m4/flexmember.m4 \ + $(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/fnmatch.m4 \ + $(top_srcdir)/m4/fnmatch_h.m4 $(top_srcdir)/m4/fpending.m4 \ $(top_srcdir)/m4/fseek.m4 $(top_srcdir)/m4/fseeko.m4 \ $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/fstatat.m4 \ $(top_srcdir)/m4/futimens.m4 \ @@ -149,7 +253,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ $(top_srcdir)/m4/group-member.m4 \ - $(top_srcdir)/m4/hard-locale.m4 \ $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/human.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/include_next.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \ @@ -244,6 +347,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ + $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -266,24 +371,25 @@ am__libgnu_a_SOURCES_DIST = acl-errno-valid.c acl-internal.c \ c-strcase.h c-strcasecmp.c c-strncasecmp.c careadlinkat.c \ cloexec.c close-stream.c closeout.c opendir-safer.c dirname.c \ basename.c dirname-lgpl.c basename-lgpl.c stripslash.c \ - exclude.c exitfail.c chmodat.c chownat.c fd-hook.c \ - fd-safer-flag.c dup-safer-flag.c fdutimensat.c file-has-acl.c \ - filenamecat-lgpl.c fprintftime.c full-write.h full-write.c \ - getprogname.h getprogname.c gettext.h gettime.c hard-locale.c \ - hash.c human.c imaxtostr.c inttostr.c offtostr.c uinttostr.c \ - umaxtostr.c localcharset.h localcharset.c malloca.c mbchar.c \ - mbscasecmp.c mbuiter.h mbuiter.c minmax.h modechange.c \ - nstrftime.c openat-die.c parse-datetime.y priv-set.c \ - progname.h progname.c quotearg.c renameat2.c safe-read.c \ - safe-write.c save-cwd.c savedir.c se-context.in.h \ - se-selinux.in.h se-context.c se-selinux.c size_max.h \ - stat-time.c statat.c strnlen1.h strnlen1.c tempname.c \ - timespec.c timespec-sub.c unistd.c dup-safer.c fd-safer.c \ - pipe-safer.c uniwidth/width.c unlinkdir.c utimens.c \ - version-etc.h version-etc.c version-etc-fsf.c wctype-h.c \ - xmalloc.c xalloc-die.c xgetcwd.c xsize.h xsize.c xstrndup.h \ - xstrndup.c xstrtol.c xstrtoul.c xstrtol-error.c xstrtoumax.c \ - xvasprintf.h xvasprintf.c xasprintf.c + exclude.c exitfail.c chmodat.c chownat.c creat-safer.c \ + open-safer.c fd-hook.c fd-safer-flag.c dup-safer-flag.c \ + fdutimensat.c file-has-acl.c filenamecat-lgpl.c fprintftime.c \ + full-write.h full-write.c getprogname.h getprogname.c \ + gettext.h gettime.c hard-locale.c hash.c human.c imaxtostr.c \ + inttostr.c offtostr.c uinttostr.c umaxtostr.c localcharset.c \ + malloca.c mbchar.c mbscasecmp.c mbuiter.h mbuiter.c minmax.h \ + modechange.c nstrftime.c openat-die.c openat-safer.c \ + opendirat.c parse-datetime.y priv-set.c progname.h progname.c \ + quotearg.c renameatu.c safe-read.c safe-write.c save-cwd.c \ + savedir.c se-context.in.h se-selinux.in.h se-context.c \ + se-selinux.c size_max.h stat-time.c statat.c strnlen1.h \ + strnlen1.c tempname.c timespec.c timespec-sub.c unistd.c \ + dup-safer.c fd-safer.c pipe-safer.c uniwidth/width.c \ + unlinkdir.c utimens.c version-etc.h version-etc.c \ + version-etc-fsf.c wctype-h.c xmalloc.c xalloc-die.c xgetcwd.c \ + xsize.h xsize.c xstrndup.h xstrndup.c xstrtol.c xstrtoul.c \ + xstrtol-error.c xstrtoumax.c xvasprintf.h xvasprintf.c \ + xasprintf.c am__dirstamp = $(am__leading_dot)dirstamp @LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE@am__objects_1 = uniwidth/width.$(OBJEXT) am_libgnu_a_OBJECTS = acl-errno-valid.$(OBJEXT) acl-internal.$(OBJEXT) \ @@ -303,30 +409,31 @@ am_libgnu_a_OBJECTS = acl-errno-valid.$(OBJEXT) acl-internal.$(OBJEXT) \ opendir-safer.$(OBJEXT) dirname.$(OBJEXT) basename.$(OBJEXT) \ dirname-lgpl.$(OBJEXT) basename-lgpl.$(OBJEXT) \ stripslash.$(OBJEXT) exclude.$(OBJEXT) exitfail.$(OBJEXT) \ - chmodat.$(OBJEXT) chownat.$(OBJEXT) fd-hook.$(OBJEXT) \ - fd-safer-flag.$(OBJEXT) dup-safer-flag.$(OBJEXT) \ - fdutimensat.$(OBJEXT) file-has-acl.$(OBJEXT) \ - filenamecat-lgpl.$(OBJEXT) fprintftime.$(OBJEXT) \ - full-write.$(OBJEXT) getprogname.$(OBJEXT) gettime.$(OBJEXT) \ - hard-locale.$(OBJEXT) hash.$(OBJEXT) human.$(OBJEXT) \ - imaxtostr.$(OBJEXT) inttostr.$(OBJEXT) offtostr.$(OBJEXT) \ - uinttostr.$(OBJEXT) umaxtostr.$(OBJEXT) localcharset.$(OBJEXT) \ - malloca.$(OBJEXT) mbchar.$(OBJEXT) mbscasecmp.$(OBJEXT) \ - mbuiter.$(OBJEXT) modechange.$(OBJEXT) nstrftime.$(OBJEXT) \ - openat-die.$(OBJEXT) parse-datetime.$(OBJEXT) \ - priv-set.$(OBJEXT) progname.$(OBJEXT) quotearg.$(OBJEXT) \ - renameat2.$(OBJEXT) safe-read.$(OBJEXT) safe-write.$(OBJEXT) \ - save-cwd.$(OBJEXT) savedir.$(OBJEXT) se-context.$(OBJEXT) \ - se-selinux.$(OBJEXT) stat-time.$(OBJEXT) statat.$(OBJEXT) \ - strnlen1.$(OBJEXT) tempname.$(OBJEXT) timespec.$(OBJEXT) \ - timespec-sub.$(OBJEXT) unistd.$(OBJEXT) dup-safer.$(OBJEXT) \ - fd-safer.$(OBJEXT) pipe-safer.$(OBJEXT) $(am__objects_1) \ - unlinkdir.$(OBJEXT) utimens.$(OBJEXT) version-etc.$(OBJEXT) \ - version-etc-fsf.$(OBJEXT) wctype-h.$(OBJEXT) xmalloc.$(OBJEXT) \ - xalloc-die.$(OBJEXT) xgetcwd.$(OBJEXT) xsize.$(OBJEXT) \ - xstrndup.$(OBJEXT) xstrtol.$(OBJEXT) xstrtoul.$(OBJEXT) \ - xstrtol-error.$(OBJEXT) xstrtoumax.$(OBJEXT) \ - xvasprintf.$(OBJEXT) xasprintf.$(OBJEXT) + chmodat.$(OBJEXT) chownat.$(OBJEXT) creat-safer.$(OBJEXT) \ + open-safer.$(OBJEXT) fd-hook.$(OBJEXT) fd-safer-flag.$(OBJEXT) \ + dup-safer-flag.$(OBJEXT) fdutimensat.$(OBJEXT) \ + file-has-acl.$(OBJEXT) filenamecat-lgpl.$(OBJEXT) \ + fprintftime.$(OBJEXT) full-write.$(OBJEXT) \ + getprogname.$(OBJEXT) gettime.$(OBJEXT) hard-locale.$(OBJEXT) \ + hash.$(OBJEXT) human.$(OBJEXT) imaxtostr.$(OBJEXT) \ + inttostr.$(OBJEXT) offtostr.$(OBJEXT) uinttostr.$(OBJEXT) \ + umaxtostr.$(OBJEXT) localcharset.$(OBJEXT) malloca.$(OBJEXT) \ + mbchar.$(OBJEXT) mbscasecmp.$(OBJEXT) mbuiter.$(OBJEXT) \ + modechange.$(OBJEXT) nstrftime.$(OBJEXT) openat-die.$(OBJEXT) \ + openat-safer.$(OBJEXT) opendirat.$(OBJEXT) \ + parse-datetime.$(OBJEXT) priv-set.$(OBJEXT) progname.$(OBJEXT) \ + quotearg.$(OBJEXT) renameatu.$(OBJEXT) safe-read.$(OBJEXT) \ + safe-write.$(OBJEXT) save-cwd.$(OBJEXT) savedir.$(OBJEXT) \ + se-context.$(OBJEXT) se-selinux.$(OBJEXT) stat-time.$(OBJEXT) \ + statat.$(OBJEXT) strnlen1.$(OBJEXT) tempname.$(OBJEXT) \ + timespec.$(OBJEXT) timespec-sub.$(OBJEXT) unistd.$(OBJEXT) \ + dup-safer.$(OBJEXT) fd-safer.$(OBJEXT) pipe-safer.$(OBJEXT) \ + $(am__objects_1) unlinkdir.$(OBJEXT) utimens.$(OBJEXT) \ + version-etc.$(OBJEXT) version-etc-fsf.$(OBJEXT) \ + wctype-h.$(OBJEXT) xmalloc.$(OBJEXT) xalloc-die.$(OBJEXT) \ + xgetcwd.$(OBJEXT) xsize.$(OBJEXT) xstrndup.$(OBJEXT) \ + xstrtol.$(OBJEXT) xstrtoul.$(OBJEXT) xstrtol-error.$(OBJEXT) \ + xstrtoumax.$(OBJEXT) xvasprintf.$(OBJEXT) xasprintf.$(OBJEXT) libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS) LTLIBRARIES = $(noinst_LTLIBRARIES) AM_V_P = $(am__v_P_@AM_V@) @@ -409,6 +516,9 @@ am__define_uniq_tagged_files = \ ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(top_srcdir)/build-aux/depcomp $(top_srcdir)/build-aux/ylwrap \ + alloca.c parse-datetime.c DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -525,6 +635,7 @@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ GNULIB_FGETC = @GNULIB_FGETC@ GNULIB_FGETS = @GNULIB_FGETS@ +GNULIB_FNMATCH = @GNULIB_FNMATCH@ GNULIB_FOPEN = @GNULIB_FOPEN@ GNULIB_FPRINTF = @GNULIB_FPRINTF@ GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@ @@ -557,6 +668,7 @@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ +GNULIB_GETPASS = @GNULIB_GETPASS@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ @@ -573,6 +685,7 @@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LOCALECONV = @GNULIB_LOCALECONV@ +GNULIB_LOCALENAME = @GNULIB_LOCALENAME@ GNULIB_LOCALTIME = @GNULIB_LOCALTIME@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_LSTAT = @GNULIB_LSTAT@ @@ -811,6 +924,7 @@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ @@ -834,6 +948,9 @@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ HAVE_FFS = @HAVE_FFS@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ +HAVE_FNMATCH = @HAVE_FNMATCH@ +HAVE_FNMATCH_H = @HAVE_FNMATCH_H@ +HAVE_FREELOCALE = @HAVE_FREELOCALE@ HAVE_FSEEKO = @HAVE_FSEEKO@ HAVE_FSTATAT = @HAVE_FSTATAT@ HAVE_FSYNC = @HAVE_FSYNC@ @@ -846,13 +963,16 @@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ +HAVE_GETPASS = @HAVE_GETPASS@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ +HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@ HAVE_INTTYPES_H = @HAVE_INTTYPES_H@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@ HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ @@ -885,6 +1005,7 @@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ +HAVE_NEWLOCALE = @HAVE_NEWLOCALE@ HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OPENDIR = @HAVE_OPENDIR@ @@ -955,7 +1076,6 @@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ -HAVE_TRUNCATE = @HAVE_TRUNCATE@ HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ HAVE_TZSET = @HAVE_TZSET@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ @@ -1010,8 +1130,6 @@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ HAVE__BOOL = @HAVE__BOOL@ HAVE__EXIT = @HAVE__EXIT@ -HOST_CPU = @HOST_CPU@ -HOST_CPU_C_ABI = @HOST_CPU_C_ABI@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL = @INSTALL@ @@ -1056,6 +1174,7 @@ NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ +NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H = @NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@ @@ -1083,6 +1202,7 @@ NEXT_DIRENT_H = @NEXT_DIRENT_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ +NEXT_FNMATCH_H = @NEXT_FNMATCH_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ @@ -1143,9 +1263,11 @@ REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FNMATCH = @REPLACE_FNMATCH@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREELOCALE = @REPLACE_FREELOCALE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FSEEK = @REPLACE_FSEEK@ REPLACE_FSEEKO = @REPLACE_FSEEKO@ @@ -1163,6 +1285,7 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLINE = @REPLACE_GETLINE@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ +REPLACE_GETPASS = @REPLACE_GETPASS@ REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ REPLACE_GMTIME = @REPLACE_GMTIME@ REPLACE_ISATTY = @REPLACE_ISATTY@ @@ -1193,6 +1316,7 @@ REPLACE_MKNOD = @REPLACE_MKNOD@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ +REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@ REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ @@ -1372,7 +1496,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AUTOMAKE_OPTIONS = 1.9.6 gnits subdir-objects +AUTOMAKE_OPTIONS = 1.11 gnits subdir-objects SUBDIRS = noinst_HEADERS = noinst_LIBRARIES = libgnu.a @@ -1399,39 +1523,40 @@ EXTRA_DIST = acl-internal.h acl.h acl_entries.c alignof.h alloca.c \ dirname.h dosname.h dup.c dup2.c errno.in.h error.c error.h \ euidaccess.c exclude.h exitfail.h at-func.c faccessat.c \ fchdir.c at-func.c fchmodat.c at-func.c fchownat.c fcntl.c \ - fcntl.in.h fd-hook.h fdopendir.c utimens.h fileblocks.c \ - filename.h filenamecat.h flexmember.h float.c float.in.h \ - itold.c fnmatch.c fnmatch.in.h fnmatch_loop.c fpending.c \ - fpending.h stdio-impl.h fprintftime.h fseek.c fseeko.c \ - stdio-impl.h fstat.c stat-w32.c stat-w32.h at-func.c fstatat.c \ - futimens.c getcwd.c getcwd-lgpl.c getdelim.c getdtablesize.c \ - getgroups.c getline.c getopt-cdefs.in.h getopt-core.h \ - getopt-ext.h getopt-pfx-core.h getopt-pfx-ext.h getopt.c \ - getopt.in.h getopt1.c getopt_int.h getpagesize.c \ - $(top_srcdir)/build-aux/config.rpath gettimeofday.c \ - $(top_srcdir)/build-aux/gitlog-to-changelog group-member.c \ - hard-locale.h hash.h $(top_srcdir)/build-aux/config.rpath \ - human.h intprops.h anytostr.c inttostr.h inttypes.in.h \ - iswblank.c langinfo.in.h lchown.c limits.in.h link.c \ - at-func2.c linkat.c config.charset ref-add.sin ref-del.sin \ - locale.in.h localeconv.c localtime-buffer.c localtime-buffer.h \ - lseek.c lstat.c malloc.c malloc.c malloca.h malloca.valgrind \ - mbchar.h mbrtowc.c mbsinit.c mbsrtowcs-impl.h \ - mbsrtowcs-state.c mbsrtowcs.c mbtowc-impl.h mbtowc.c memchr.c \ - memchr.valgrind mempcpy.c memrchr.c mkdir.c at-func.c \ - mkdirat.c mkdtemp.c mkfifo.c at-func.c mkfifoat.c mknodat.c \ - mknod.c mktime-internal.h mktime.c mktime-internal.h mktime.c \ - modechange.h msvc-inval.c msvc-inval.h msvc-nothrow.c \ + fcntl.in.h fcntl--.h fcntl-safer.h fd-hook.h fdopendir.c \ + utimens.h fileblocks.c filename.h filenamecat.h flexmember.h \ + float.c float.in.h itold.c fnmatch.c fnmatch_loop.c \ + fnmatch.in.h fpending.c fpending.h stdio-impl.h fprintftime.h \ + fseek.c fseeko.c stdio-impl.h fstat.c stat-w32.c stat-w32.h \ + at-func.c fstatat.c futimens.c getcwd.c getcwd-lgpl.c \ + getdelim.c getdtablesize.c getgroups.c getline.c \ + getopt-cdefs.in.h getopt-core.h getopt-ext.h getopt-pfx-core.h \ + getopt-pfx-ext.h getopt.c getopt.in.h getopt1.c getopt_int.h \ + getpagesize.c $(top_srcdir)/build-aux/config.rpath \ + gettimeofday.c $(top_srcdir)/build-aux/gitlog-to-changelog \ + group-member.c hard-locale.h hash.h \ + $(top_srcdir)/build-aux/config.rpath human.h intprops.h \ + anytostr.c inttostr.h inttypes.in.h iswblank.c langinfo.in.h \ + lchown.c cdefs.h libc-config.h limits.in.h link.c at-func2.c \ + linkat.c localcharset.h locale.in.h localeconv.c \ + localtime-buffer.c localtime-buffer.h lseek.c lstat.c malloc.c \ + malloc.c malloca.h mbchar.h mbrtowc.c mbsinit.c \ + mbsrtowcs-impl.h mbsrtowcs-state.c mbsrtowcs.c mbtowc-impl.h \ + mbtowc.c memchr.c memchr.valgrind mempcpy.c memrchr.c mkdir.c \ + at-func.c mkdirat.c mkdtemp.c mkfifo.c at-func.c mkfifoat.c \ + mknodat.c mknod.c mktime-internal.h mktime.c mktime-internal.h \ + mktime.c modechange.h msvc-inval.c msvc-inval.h msvc-nothrow.c \ msvc-nothrow.h nl_langinfo.c strftime.h obstack.c obstack.h \ - open.c openat.c openat.h dirent-private.h opendir.c \ - parse-datetime.c parse-datetime.h pathmax.h priv-set.h quote.h \ - quote.h quotearg.h raise.c rawmemchr.c rawmemchr.valgrind \ - read.c dirent-private.h readdir.c readlink.c at-func.c \ - readlinkat.c realloc.c regcomp.c regex.c regex.h \ - regex_internal.c regex_internal.h regexec.c rename.c \ - renameat.c at-func2.c renameat2.h dirent-private.h rewinddir.c \ - rmdir.c root-uid.h rpmatch.c safe-read.h safe-read.c \ - safe-write.h same-inode.h save-cwd.h savedir.h at-func.c \ + open.c openat.c openat.h fcntl--.h fcntl-safer.h \ + dirent-private.h opendir.c opendirat.h parse-datetime.c \ + parse-datetime.h pathmax.h priv-set.h quote.h quote.h \ + quotearg.h raise.c rawmemchr.c rawmemchr.valgrind read.c \ + dirent-private.h readdir.c readlink.c at-func.c readlinkat.c \ + realloc.c regcomp.c regex.c regex.h regex_internal.c \ + regex_internal.h regexec.c rename.c renameat.c at-func2.c \ + renameatu.h dirent-private.h rewinddir.c rmdir.c root-uid.h \ + rpmatch.c safe-read.h sys-limits.h safe-read.c safe-write.h \ + sys-limits.h same-inode.h save-cwd.h savedir.h at-func.c \ selinux-at.c selinux-at.h getfilecon.c setenv.c signal.in.h \ sleep.c _Noreturn.h arg-nonnull.h c++defs.h unused-parameter.h \ warn-on-use.h snprintf.c stat-w32.c stat-w32.h stat.c \ @@ -1462,7 +1587,7 @@ BUILT_SOURCES = $(ALLOCA_H) configmake.h dirent.h $(ERRNO_H) fcntl.h \ stdlib.h string.h strings.h sys/stat.h sys/time.h sys/types.h \ $(SYSEXITS_H) time.h unistd.h $(LIBUNISTRING_UNITYPES_H) \ $(LIBUNISTRING_UNIWIDTH_H) $(UTIME_H) wchar.h wctype.h -SUFFIXES = .sed .sin +SUFFIXES = MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t dirent.h \ dirent.h-t errno.h errno.h-t fcntl.h fcntl.h-t float.h \ float.h-t fnmatch.h fnmatch.h-t getopt.h getopt.h-t \ @@ -1479,8 +1604,7 @@ MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t dirent.h \ unitypes.h-t uniwidth.h uniwidth.h-t utime.h utime.h-t wchar.h \ wchar.h-t wctype.h wctype.h-t MOSTLYCLEANDIRS = selinux sys -CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \ - ref-del.sed +CLEANFILES = configmake.h configmake.h-t DISTCLEANFILES = MAINTAINERCLEANFILES = parse-datetime.c # No GNU Make output. @@ -1497,24 +1621,25 @@ libgnu_a_SOURCES = acl-errno-valid.c acl-internal.c get-permissions.c \ c-strcase.h c-strcasecmp.c c-strncasecmp.c careadlinkat.c \ cloexec.c close-stream.c closeout.c opendir-safer.c dirname.c \ basename.c dirname-lgpl.c basename-lgpl.c stripslash.c \ - exclude.c exitfail.c chmodat.c chownat.c fd-hook.c \ - fd-safer-flag.c dup-safer-flag.c fdutimensat.c file-has-acl.c \ - filenamecat-lgpl.c fprintftime.c full-write.h full-write.c \ - getprogname.h getprogname.c gettext.h gettime.c hard-locale.c \ - hash.c human.c imaxtostr.c inttostr.c offtostr.c uinttostr.c \ - umaxtostr.c localcharset.h localcharset.c malloca.c mbchar.c \ - mbscasecmp.c mbuiter.h mbuiter.c minmax.h modechange.c \ - nstrftime.c openat-die.c parse-datetime.y priv-set.c \ - progname.h progname.c quotearg.c renameat2.c safe-read.c \ - safe-write.c save-cwd.c savedir.c se-context.in.h \ - se-selinux.in.h se-context.c se-selinux.c size_max.h \ - stat-time.c statat.c strnlen1.h strnlen1.c tempname.c \ - timespec.c timespec-sub.c unistd.c dup-safer.c fd-safer.c \ - pipe-safer.c $(am__append_1) unlinkdir.c utimens.c \ - version-etc.h version-etc.c version-etc-fsf.c wctype-h.c \ - xmalloc.c xalloc-die.c xgetcwd.c xsize.h xsize.c xstrndup.h \ - xstrndup.c xstrtol.c xstrtoul.c xstrtol-error.c xstrtoumax.c \ - xvasprintf.h xvasprintf.c xasprintf.c + exclude.c exitfail.c chmodat.c chownat.c creat-safer.c \ + open-safer.c fd-hook.c fd-safer-flag.c dup-safer-flag.c \ + fdutimensat.c file-has-acl.c filenamecat-lgpl.c fprintftime.c \ + full-write.h full-write.c getprogname.h getprogname.c \ + gettext.h gettime.c hard-locale.c hash.c human.c imaxtostr.c \ + inttostr.c offtostr.c uinttostr.c umaxtostr.c localcharset.c \ + malloca.c mbchar.c mbscasecmp.c mbuiter.h mbuiter.c minmax.h \ + modechange.c nstrftime.c openat-die.c openat-safer.c \ + opendirat.c parse-datetime.y priv-set.c progname.h progname.c \ + quotearg.c renameatu.c safe-read.c safe-write.c save-cwd.c \ + savedir.c se-context.in.h se-selinux.in.h se-context.c \ + se-selinux.c size_max.h stat-time.c statat.c strnlen1.h \ + strnlen1.c tempname.c timespec.c timespec-sub.c unistd.c \ + dup-safer.c fd-safer.c pipe-safer.c $(am__append_1) \ + unlinkdir.c utimens.c version-etc.h version-etc.c \ + version-etc-fsf.c wctype-h.c xmalloc.c xalloc-die.c xgetcwd.c \ + xsize.h xsize.c xstrndup.h xstrndup.c xstrtol.c xstrtoul.c \ + xstrtol-error.c xstrtoumax.c xvasprintf.h xvasprintf.c \ + xasprintf.c libgnu_a_LIBADD = $(gl_LIBOBJS) @ALLOCA@ libgnu_a_DEPENDENCIES = $(gl_LIBOBJS) @ALLOCA@ EXTRA_libgnu_a_SOURCES = acl_entries.c alloca.c at-func.c at-func.c \ @@ -1552,8 +1677,6 @@ EXTRA_libgnu_a_SOURCES = acl_entries.c alloca.c at-func.c at-func.c \ # Do not rely on a 'configure'-time test for this, since the expression # might appear in an installed header, which is used by some other compiler. HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER) -charset_alias = $(DESTDIR)$(libdir)/charset.alias -charset_tmp = $(DESTDIR)$(libdir)/charset.tmp # Because this Makefile snippet defines a variable used by other # gnulib Makefile snippets, it must be present in all makefiles that @@ -1583,7 +1706,7 @@ all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: -.SUFFIXES: .sed .sin .c .o .obj .y +.SUFFIXES: .c .o .obj .y $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -1596,7 +1719,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits gnu/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnits gnu/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -1696,6 +1818,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closedir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closeout.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat-safer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirfd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname-lgpl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname.Po@am__quote@ @@ -1790,12 +1913,15 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nstrftime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/obstack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/offtostr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open-safer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-die.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-proc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-safer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opendir-safer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opendir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opendirat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse-datetime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe-safer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-args.Po@am__quote@ @@ -1816,7 +1942,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regexec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rename.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameatu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rewinddir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpmatch.Po@am__quote@ @@ -2069,7 +2195,7 @@ distdir: $(DISTFILES) check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive -all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(HEADERS) all-local +all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: install: $(BUILT_SOURCES) @@ -2140,7 +2266,7 @@ install-dvi: install-dvi-recursive install-dvi-am: -install-exec-am: install-exec-local +install-exec-am: install-html: install-html-recursive @@ -2180,25 +2306,26 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-local +uninstall-am: .MAKE: $(am__recursive_targets) all check install install-am \ install-strip -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \ - check check-am clean clean-generic clean-noinstLIBRARIES \ +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-noinstLIBRARIES \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-exec-local install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-local pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-local + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-local pdf \ + pdf-am ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile # We need the following in order to create when the system @@ -2354,21 +2481,31 @@ fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) @GL_GENERATE_FLOAT_H_FALSE@float.h: $(top_builddir)/config.status @GL_GENERATE_FLOAT_H_FALSE@ rm -f $@ -# We need the following in order to create when the system -# doesn't have one that supports the required API. -@GL_GENERATE_FNMATCH_H_TRUE@fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) +# We need the following in order to create . +@GL_GENERATE_FNMATCH_H_TRUE@fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) @GL_GENERATE_FNMATCH_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ -@GL_GENERATE_FNMATCH_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ -@GL_GENERATE_FNMATCH_H_TRUE@ sed -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ +@GL_GENERATE_FNMATCH_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_FNMATCH_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_FNMATCH_H_TRUE@ -e 's|@''HAVE_FNMATCH_H''@|$(HAVE_FNMATCH_H)|g' \ +@GL_GENERATE_FNMATCH_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_FNMATCH_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_FNMATCH_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_FNMATCH_H_TRUE@ -e 's|@''NEXT_FNMATCH_H''@|$(NEXT_FNMATCH_H)|g' \ +@GL_GENERATE_FNMATCH_H_TRUE@ -e 's/@''GNULIB_FNMATCH''@/$(GNULIB_FNMATCH)/g' \ +@GL_GENERATE_FNMATCH_H_TRUE@ -e 's|@''HAVE_FNMATCH''@|$(HAVE_FNMATCH)|g' \ +@GL_GENERATE_FNMATCH_H_TRUE@ -e 's|@''REPLACE_FNMATCH''@|$(REPLACE_FNMATCH)|g' \ +@GL_GENERATE_FNMATCH_H_TRUE@ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ +@GL_GENERATE_FNMATCH_H_TRUE@ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ +@GL_GENERATE_FNMATCH_H_TRUE@ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ @GL_GENERATE_FNMATCH_H_TRUE@ < $(srcdir)/fnmatch.in.h; \ @GL_GENERATE_FNMATCH_H_TRUE@ } > $@-t && \ -@GL_GENERATE_FNMATCH_H_TRUE@ mv -f $@-t $@ +@GL_GENERATE_FNMATCH_H_TRUE@ mv $@-t $@ @GL_GENERATE_FNMATCH_H_FALSE@fnmatch.h: $(top_builddir)/config.status @GL_GENERATE_FNMATCH_H_FALSE@ rm -f $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. -getopt.h: getopt.in.h $(top_builddir)/config.status +getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ @@ -2413,6 +2550,7 @@ inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \ -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \ -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \ + -e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \ -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \ -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \ -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \ @@ -2440,6 +2578,7 @@ langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U -e 's/@''GNULIB_NL_LANGINFO''@/$(GNULIB_NL_LANGINFO)/g' \ -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \ -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \ + -e 's|@''HAVE_LANGINFO_ALTMON''@|$(HAVE_LANGINFO_ALTMON)|g' \ -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \ -e 's|@''HAVE_LANGINFO_YESEXPR''@|$(HAVE_LANGINFO_YESEXPR)|g' \ -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \ @@ -2466,65 +2605,6 @@ langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U @GL_GENERATE_LIMITS_H_FALSE@limits.h: $(top_builddir)/config.status @GL_GENERATE_LIMITS_H_FALSE@ rm -f $@ -# We need the following in order to install a simple file in $(libdir) -# which is shared with other installed packages. We use a list of referencing -# packages so that "make uninstall" will remove the file if and only if it -# is not used by another installed package. -# On systems with glibc-2.1 or newer, the file is redundant, therefore we -# avoid installing it. - -all-local: charset.alias ref-add.sed ref-del.sed -install-exec-local: install-exec-localcharset -install-exec-localcharset: all-local - if test $(GLIBC21) = no; then \ - case '$(host_os)' in \ - darwin[56]*) \ - need_charset_alias=true ;; \ - darwin* | cygwin* | mingw* | pw32* | cegcc*) \ - need_charset_alias=false ;; \ - *) \ - need_charset_alias=true ;; \ - esac ; \ - else \ - need_charset_alias=false ; \ - fi ; \ - if $$need_charset_alias; then \ - $(mkinstalldirs) $(DESTDIR)$(libdir) ; \ - fi ; \ - if test -f $(charset_alias); then \ - sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \ - $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ - rm -f $(charset_tmp) ; \ - else \ - if $$need_charset_alias; then \ - sed -f ref-add.sed charset.alias > $(charset_tmp) ; \ - $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ - rm -f $(charset_tmp) ; \ - fi ; \ - fi - -uninstall-local: uninstall-localcharset -uninstall-localcharset: all-local - if test -f $(charset_alias); then \ - sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \ - if grep '^# Packages using this file: $$' $(charset_tmp) \ - > /dev/null; then \ - rm -f $(charset_alias); \ - else \ - $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \ - fi; \ - rm -f $(charset_tmp); \ - fi - -charset.alias: config.charset - $(AM_V_GEN)rm -f t-$@ $@ && \ - $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \ - mv t-$@ $@ -.sin.sed: - $(AM_V_GEN)rm -f t-$@ $@ && \ - sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \ - mv t-$@ $@ - # We need the following in order to create when the system # doesn't have one that provides all definitions. locale.h: locale.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) @@ -2538,11 +2618,16 @@ locale.h: locale.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's/@''GNULIB_LOCALECONV''@/$(GNULIB_LOCALECONV)/g' \ -e 's/@''GNULIB_SETLOCALE''@/$(GNULIB_SETLOCALE)/g' \ -e 's/@''GNULIB_DUPLOCALE''@/$(GNULIB_DUPLOCALE)/g' \ + -e 's/@''GNULIB_LOCALENAME''@/$(GNULIB_LOCALENAME)/g' \ + -e 's|@''HAVE_NEWLOCALE''@|$(HAVE_NEWLOCALE)|g' \ -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|g' \ + -e 's|@''HAVE_FREELOCALE''@|$(HAVE_FREELOCALE)|g' \ -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \ -e 's|@''REPLACE_LOCALECONV''@|$(REPLACE_LOCALECONV)|g' \ -e 's|@''REPLACE_SETLOCALE''@|$(REPLACE_SETLOCALE)|g' \ + -e 's|@''REPLACE_NEWLOCALE''@|$(REPLACE_NEWLOCALE)|g' \ -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \ + -e 's|@''REPLACE_FREELOCALE''@|$(REPLACE_FREELOCALE)|g' \ -e 's|@''REPLACE_STRUCT_LCONV''@|$(REPLACE_STRUCT_LCONV)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ @@ -2600,8 +2685,8 @@ signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \ - -e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \ - -e 's|@''GNULIB_RAISE''@|$(GNULIB_RAISE)|g' \ + -e 's/@''GNULIB_PTHREAD_SIGMASK''@/$(GNULIB_PTHREAD_SIGMASK)/g' \ + -e 's/@''GNULIB_RAISE''@/$(GNULIB_RAISE)/g' \ -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \ -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \ -e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \ @@ -3044,7 +3129,7 @@ strings.h: strings.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \ - -e 's|@''GNULIB_FFS''@|$(GNULIB_FFS)|g' \ + -e 's/@''GNULIB_FFS''@/$(GNULIB_FFS)/g' \ -e 's|@''HAVE_FFS''@|$(HAVE_FFS)|g' \ -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \ -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \ @@ -3248,6 +3333,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \ -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \ -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \ + -e 's/@''GNULIB_GETPASS''@/$(GNULIB_GETPASS)/g' \ -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \ -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \ -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \ @@ -3291,6 +3377,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GETPASS''@|$(HAVE_GETPASS)|g' \ -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ @@ -3305,7 +3392,6 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \ -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \ - -e 's|@''HAVE_TRUNCATE''@|$(HAVE_TRUNCATE)|g' \ -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ @@ -3317,6 +3403,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \ + -e 's|@''HAVE_DECL_TRUNCATE''@|$(HAVE_DECL_TRUNCATE)|g' \ -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \ -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ @@ -3334,6 +3421,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \ -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \ -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ + -e 's|@''REPLACE_GETPASS''@|$(REPLACE_GETPASS)|g' \ -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \ -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \ @@ -3378,7 +3466,7 @@ uniwidth.h: uniwidth.in.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. -@GL_GENERATE_UTIME_H_TRUE@utime.h: utime.in.h $(top_builddir)/config.status +@GL_GENERATE_UTIME_H_TRUE@utime.h: utime.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) @GL_GENERATE_UTIME_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ @GL_GENERATE_UTIME_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ @GL_GENERATE_UTIME_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ diff --git a/gnu/_Noreturn.h b/gnu/_Noreturn.h index c44ad89b7c09315601bfb48467992f9fff797093..94fdfaf0220f98b42c569d0f9040ee6df3306ce4 100644 --- a/gnu/_Noreturn.h +++ b/gnu/_Noreturn.h @@ -1,8 +1,12 @@ -#if !defined _Noreturn && __STDC_VERSION__ < 201112 -# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ - || 0x5110 <= __SUNPRO_C) +#ifndef _Noreturn +# if 201103 <= (defined __cplusplus ? __cplusplus : 0) +# define _Noreturn [[noreturn]] +# elif (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ + || 4 < __GNUC__ + (7 <= __GNUC_MINOR__)) + /* _Noreturn works as-is. */ +# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C # define _Noreturn __attribute__ ((__noreturn__)) -# elif 1200 <= _MSC_VER +# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0) # define _Noreturn __declspec (noreturn) # else # define _Noreturn diff --git a/gnu/acl-errno-valid.c b/gnu/acl-errno-valid.c index 1e96974dd123fd8c38b79f93b54070ad8a459221..99ddf3bb0c3bb66fac6458ecdce939efea23e79d 100644 --- a/gnu/acl-errno-valid.c +++ b/gnu/acl-errno-valid.c @@ -1,6 +1,6 @@ /* Test whether ACLs are well supported on this system. - Copyright 2013-2017 Free Software Foundation, Inc. + Copyright 2013-2019 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 diff --git a/gnu/acl-internal.c b/gnu/acl-internal.c index 63e6b6b997c274b769da659f5c6cb71826dc30de..cc42183f4437faa8a693673d6414e4b93a6aec47 100644 --- a/gnu/acl-internal.c +++ b/gnu/acl-internal.c @@ -1,6 +1,6 @@ /* Test whether a file has a nontrivial ACL. -*- coding: utf-8 -*- - Copyright (C) 2002-2003, 2005-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2019 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 @@ -23,7 +23,7 @@ #include "acl-internal.h" -#if USE_ACL && HAVE_ACL_GET_FILE +#if USE_ACL && HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */ # if HAVE_ACL_TYPE_EXTENDED /* Mac OS X */ @@ -37,7 +37,7 @@ acl_extended_nontrivial (acl_t acl) return (acl_entries (acl) > 0); } -# else /* Linux, FreeBSD, IRIX, Tru64 */ +# else /* Linux, FreeBSD, IRIX, Tru64, Cygwin >= 2.5 */ /* ACL is an ACL, from a file, stored as type ACL_TYPE_ACCESS. Return 1 if the given ACL is non-trivial. @@ -51,7 +51,7 @@ acl_access_nontrivial (acl_t acl) at least, allowing us to write return (3 < acl_entries (acl)); but the following code is more robust. */ -# if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD */ +# if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD, Cygwin >= 2.5 */ acl_entry_t ace; int got_one; @@ -124,7 +124,7 @@ acl_default_nontrivial (acl_t acl) # endif -#elif USE_ACL && HAVE_FACL && defined GETACL /* Solaris, Cygwin, not HP-UX */ +#elif USE_ACL && HAVE_FACL && defined GETACL /* Solaris, Cygwin < 2.5, not HP-UX */ /* Test an ACL retrieved with GETACL. Return 1 if the given ACL, consisting of COUNT entries, is non-trivial. @@ -355,7 +355,7 @@ acl_nontrivial (int count, struct acl_entry *entries) struct acl_entry *ace = &entries[i]; if (ace->uid != ACL_NSUSER && ace->gid != ACL_NSGROUP) - return 1; + return 1; } return 0; } @@ -479,7 +479,7 @@ void free_permission_context (struct permission_context *ctx) { #if USE_ACL -# if HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, IRIX, Tru64 */ +# if HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */ if (ctx->acl) acl_free (ctx->acl); # if !HAVE_ACL_TYPE_EXTENDED @@ -487,7 +487,7 @@ free_permission_context (struct permission_context *ctx) acl_free (ctx->default_acl); # endif -# elif defined GETACL /* Solaris, Cygwin */ +# elif defined GETACL /* Solaris, Cygwin < 2.5 */ free (ctx->entries); # ifdef ACE_GETACL free (ctx->ace_entries); diff --git a/gnu/acl-internal.h b/gnu/acl-internal.h index ebd24217bb6da404467f8f24e70cc524a1c5c494..05833efaa8964b34c25edcf42333f9dc660a14c4 100644 --- a/gnu/acl-internal.h +++ b/gnu/acl-internal.h @@ -1,6 +1,6 @@ /* Internal implementation of access control lists. -*- coding: utf-8 -*- - Copyright (C) 2002-2003, 2005-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2019 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 @@ -30,7 +30,8 @@ # define GETACLCNT ACL_CNT #endif -/* On Linux, additional ACL related API is available in . */ +/* On Linux and Cygwin >= 2.5, additional ACL related API is available in + . */ #ifdef HAVE_ACL_LIBACL_H # include #endif @@ -72,7 +73,7 @@ _GL_INLINE_HEADER_BEGIN # if HAVE_ACL_GET_FILE /* POSIX 1003.1e (draft 17 -- abandoned) specific version. */ -/* Linux, FreeBSD, Mac OS X, IRIX, Tru64 */ +/* Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */ # ifndef MIN_ACL_ENTRIES # define MIN_ACL_ENTRIES 4 @@ -122,7 +123,10 @@ rpl_acl_set_fd (int fd, acl_t acl) # endif /* Linux-specific */ -# ifndef HAVE_ACL_EXTENDED_FILE +/* Cygwin >= 2.5 implements this function, but it returns 1 for all + directories, thus is unusable. */ +# if !defined HAVE_ACL_EXTENDED_FILE || defined __CYGWIN__ +# undef HAVE_ACL_EXTENDED_FILE # define HAVE_ACL_EXTENDED_FILE false # define acl_extended_file(name) (-1) # endif @@ -163,7 +167,7 @@ extern int acl_access_nontrivial (acl_t); extern int acl_default_nontrivial (acl_t); # endif -# elif HAVE_FACL && defined GETACL /* Solaris, Cygwin, not HP-UX */ +# elif HAVE_FACL && defined GETACL /* Solaris, Cygwin < 2.5, not HP-UX */ /* Set to 0 if a file's mode is stored independently from the ACL. */ # if defined __CYGWIN__ /* Cygwin */ @@ -256,14 +260,14 @@ extern int acl_nontrivial (int count, struct acl *entries); struct permission_context { mode_t mode; #if USE_ACL -# if HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, IRIX, Tru64 */ +# if HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */ acl_t acl; # if !HAVE_ACL_TYPE_EXTENDED acl_t default_acl; # endif bool acls_not_supported; -# elif defined GETACL /* Solaris, Cygwin */ +# elif defined GETACL /* Solaris, Cygwin < 2.5 */ int count; aclent_t *entries; # ifdef ACE_GETACL @@ -293,10 +297,6 @@ struct permission_context { int get_permissions (const char *, int, mode_t, struct permission_context *); int set_permissions (struct permission_context *, const char *, int); -void free_permission_context (struct permission_context *) -#if ! (defined USE_ACL && (HAVE_ACL_GET_FILE || defined GETACL)) - _GL_ATTRIBUTE_CONST -#endif - ; +void free_permission_context (struct permission_context *); _GL_INLINE_HEADER_END diff --git a/gnu/acl.h b/gnu/acl.h index d3b048022e39055f57a71eadc8da8a28e7986fcd..904606dfac73c7d8e5c8d6e02a6edfa3fd17a3fc 100644 --- a/gnu/acl.h +++ b/gnu/acl.h @@ -1,6 +1,6 @@ /* acl.c - access control lists - Copyright (C) 2002, 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2002, 2008-2019 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 diff --git a/gnu/acl_entries.c b/gnu/acl_entries.c index c7efaefd52f39548b9564025d73e421e565eeec3..19ac3c3bd9fc5976d3bdea59dbb50157164d4627 100644 --- a/gnu/acl_entries.c +++ b/gnu/acl_entries.c @@ -1,6 +1,6 @@ /* Return the number of entries in an ACL. - Copyright (C) 2002-2003, 2005-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2019 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 @@ -22,7 +22,7 @@ #include "acl-internal.h" /* This file assumes POSIX-draft like ACLs - (Linux, FreeBSD, Mac OS X, IRIX, Tru64). */ + (Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5). */ /* Return the number of entries in ACL. Return -1 and set errno upon failure to determine it. */ @@ -34,7 +34,7 @@ acl_entries (acl_t acl) if (acl != NULL) { -#if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD, Mac OS X */ +#if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD, Mac OS X, Cygwin >= 2.5 */ # if HAVE_ACL_TYPE_EXTENDED /* Mac OS X */ /* acl_get_entry returns 0 when it successfully fetches an entry, and -1/EINVAL at the end. */ @@ -45,7 +45,7 @@ acl_entries (acl_t acl) got_one >= 0; got_one = acl_get_entry (acl, ACL_NEXT_ENTRY, &ace)) count++; -# else /* Linux, FreeBSD */ +# else /* Linux, FreeBSD, Cygwin >= 2.5 */ /* acl_get_entry returns 1 when it successfully fetches an entry, and 0 at the end. */ acl_entry_t ace; diff --git a/gnu/alignof.h b/gnu/alignof.h index 21761d7bede21258c334d59880c96f0c2cd2db48..46f4ad09586e300b30c25cfe53d1f173c05b1ac0 100644 --- a/gnu/alignof.h +++ b/gnu/alignof.h @@ -1,5 +1,5 @@ /* Determine alignment of types. - Copyright (C) 2003-2004, 2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2003-2004, 2006, 2009-2019 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 diff --git a/gnu/alloca.in.h b/gnu/alloca.in.h index 1881e74f5dc22927dee38f9406dcce8c6b46dc4d..ec81e119a0ff836079968f6d83bc4b3dba6497fe 100644 --- a/gnu/alloca.in.h +++ b/gnu/alloca.in.h @@ -1,6 +1,6 @@ /* Memory allocation on the stack. - Copyright (C) 1995, 1999, 2001-2004, 2006-2017 Free Software Foundation, + Copyright (C) 1995, 1999, 2001-2004, 2006-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it diff --git a/gnu/allocator.h b/gnu/allocator.h index fc3d646aa542f39ba831f6d9c23a05e4010fdc4f..5a632ba6ff358cd03a1e0199b5405f568ad31878 100644 --- a/gnu/allocator.h +++ b/gnu/allocator.h @@ -1,6 +1,6 @@ /* Memory allocators such as malloc+free. - Copyright (C) 2011-2017 Free Software Foundation, Inc. + Copyright (C) 2011-2019 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 diff --git a/gnu/anytostr.c b/gnu/anytostr.c index 9bf9e15f6c26d1a9f0efe414b6c24cc291867cf0..18902885f71c249fd89f13ffa6361c1f1ace1c4b 100644 --- a/gnu/anytostr.c +++ b/gnu/anytostr.c @@ -1,6 +1,6 @@ /* anytostr.c -- convert integers to printable strings - Copyright (C) 2001, 2006, 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2001, 2006, 2008-2019 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 diff --git a/gnu/areadlink-with-size.c b/gnu/areadlink-with-size.c index dbca6fcd8287c342625801e1e8ca7e1f7275a8f9..eacad3f613deb4f7805bfd0bac8edcd9a2796ca5 100644 --- a/gnu/areadlink-with-size.c +++ b/gnu/areadlink-with-size.c @@ -1,7 +1,7 @@ /* readlink wrapper to return the link name in malloc'd storage. Unlike xreadlink and xreadlink_with_size, don't ever call exit. - Copyright (C) 2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2001, 2003-2007, 2009-2019 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 diff --git a/gnu/areadlink.c b/gnu/areadlink.c index f7609b1c3aff680fc9d83e80ec9b3d3cd10ae970..059435624db5ceddc827fa3fcc95092c401c680b 100644 --- a/gnu/areadlink.c +++ b/gnu/areadlink.c @@ -1,7 +1,7 @@ /* areadlink.c -- readlink wrapper to return the link name in malloc'd storage Unlike xreadlink and xreadlink_with_size, don't ever call exit. - Copyright (C) 2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2001, 2003-2007, 2009-2019 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 diff --git a/gnu/areadlink.h b/gnu/areadlink.h index 87efd508d0cc7581049f266ebc163012449a1968..ddcd06d7d7af3c2102ed4ef928e8287c092d5036 100644 --- a/gnu/areadlink.h +++ b/gnu/areadlink.h @@ -1,6 +1,6 @@ /* Read symbolic links without size limitation. - Copyright (C) 2001, 2003-2004, 2007, 2009-2017 Free Software Foundation, + Copyright (C) 2001, 2003-2004, 2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/areadlinkat-with-size.c b/gnu/areadlinkat-with-size.c index fa3773fcb8037297cfe9d8d7e17577b7ffad042d..ed00b98e4df8b277b96837f05b471247cfb63307 100644 --- a/gnu/areadlinkat-with-size.c +++ b/gnu/areadlinkat-with-size.c @@ -1,7 +1,7 @@ /* readlinkat wrapper to return the link name in malloc'd storage. Unlike xreadlinkat, only call exit on failure to change directory. - Copyright (C) 2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2001, 2003-2007, 2009-2019 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 diff --git a/gnu/areadlinkat.c b/gnu/areadlinkat.c index 65e7334afac61ceeef79f39ffb1e4d946d45e6d8..6dfbb6102394f14649be2a1fd85213456669898f 100644 --- a/gnu/areadlinkat.c +++ b/gnu/areadlinkat.c @@ -1,7 +1,7 @@ /* areadlinkat.c -- readlinkat wrapper to return malloc'd link name Unlike xreadlinkat, only call exit on failure to change directory. - Copyright (C) 2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2001, 2003-2007, 2009-2019 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 diff --git a/gnu/arg-nonnull.h b/gnu/arg-nonnull.h index 61ee07127477470ac1f35c276b0e9fafa2b03985..ad8c26c225e7c0c0857ec5c12d395a2e098248ae 100644 --- a/gnu/arg-nonnull.h +++ b/gnu/arg-nonnull.h @@ -1,5 +1,5 @@ /* A C macro for declaring that specific arguments must not be NULL. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/argmatch.c b/gnu/argmatch.c index 59858ec6818ee44050ba86350668de1625132e91..b9a3e400c41dc618b043c0a6bf1d0b59dbd9801f 100644 --- a/gnu/argmatch.c +++ b/gnu/argmatch.c @@ -1,6 +1,6 @@ /* argmatch.c -- find a match for a string in an array - Copyright (C) 1990, 1998-1999, 2001-2007, 2009-2017 Free Software + Copyright (C) 1990, 1998-1999, 2001-2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/argmatch.h b/gnu/argmatch.h index 84508545057dcab81122c4c15a6b76739f4758bf..51d2885879d84423b4f20f4d8fa26fe6b544e8b9 100644 --- a/gnu/argmatch.h +++ b/gnu/argmatch.h @@ -1,6 +1,6 @@ /* argmatch.h -- definitions and prototypes for argmatch.c - Copyright (C) 1990, 1998-1999, 2001-2002, 2004-2005, 2009-2017 Free Software + Copyright (C) 1990, 1998-1999, 2001-2002, 2004-2005, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/argp-ba.c b/gnu/argp-ba.c index c2aadf00abaa45909916f81e9a202c221fde3762..fcf60c82d17c65671c24dbe9663e63905e72ab12 100644 --- a/gnu/argp-ba.c +++ b/gnu/argp-ba.c @@ -1,5 +1,5 @@ /* Default definition for ARGP_PROGRAM_BUG_ADDRESS. - Copyright (C) 1996-2017 Free Software Foundation, Inc. + Copyright (C) 1996-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . diff --git a/gnu/argp-eexst.c b/gnu/argp-eexst.c index 823e3077c0641ead0f44c2b5443994fd0865bb6e..06b025d469696cd3bb400e1db97e769aa9831c9b 100644 --- a/gnu/argp-eexst.c +++ b/gnu/argp-eexst.c @@ -1,5 +1,5 @@ /* Default definition for ARGP_ERR_EXIT_STATUS - Copyright (C) 1997, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1997, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . diff --git a/gnu/argp-fmtstream.c b/gnu/argp-fmtstream.c index 92333fe7162cf11a629d5869e61b442a694c3daf..ba6a407f7cf960264c7ec788a087f55baf756776 100644 --- a/gnu/argp-fmtstream.c +++ b/gnu/argp-fmtstream.c @@ -1,5 +1,5 @@ /* Word-wrapping and line-truncating streams - Copyright (C) 1997-2017 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . diff --git a/gnu/argp-fmtstream.h b/gnu/argp-fmtstream.h index f6deebdccc6655a1d6d9568af7786ad0a63d69b4..0cc88525e43b9c185b0f2cb25eb13ed423900205 100644 --- a/gnu/argp-fmtstream.h +++ b/gnu/argp-fmtstream.h @@ -1,5 +1,5 @@ /* Word-wrapping and line-truncating streams. - Copyright (C) 1997-2017 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . diff --git a/gnu/argp-fs-xinl.c b/gnu/argp-fs-xinl.c index c88fd165840fc7af9c5a7df303f42e86e4614946..a2e843c877b11c0d5c8b0a74108600566b393de0 100644 --- a/gnu/argp-fs-xinl.c +++ b/gnu/argp-fs-xinl.c @@ -1,5 +1,5 @@ /* Real definitions for extern inline functions in argp-fmtstream.h - Copyright (C) 1997-2017 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . diff --git a/gnu/argp-help.c b/gnu/argp-help.c index 0a98c682b79dd675e531ce9838ef12084653e269..e5375a0f044d7257061a3977ab8f336211ce7cec 100644 --- a/gnu/argp-help.c +++ b/gnu/argp-help.c @@ -1,5 +1,5 @@ /* Hierarchical argument parsing help output - Copyright (C) 1995-2017 Free Software Foundation, Inc. + Copyright (C) 1995-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . diff --git a/gnu/argp-namefrob.h b/gnu/argp-namefrob.h index a1c9a01a5c3f6d3c8bfae2a7240508cd79fc2fc6..2fb9ac49477c5c9056a46a84e4324d2129a6daf4 100644 --- a/gnu/argp-namefrob.h +++ b/gnu/argp-namefrob.h @@ -1,5 +1,5 @@ /* Name frobnication for compiling argp outside of glibc - Copyright (C) 1997-2017 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . diff --git a/gnu/argp-parse.c b/gnu/argp-parse.c index 9a86044cd60a100ff0e9fb4635270119dd25067d..6dec573101838aca97b0972bbb758217ae8fe15b 100644 --- a/gnu/argp-parse.c +++ b/gnu/argp-parse.c @@ -1,5 +1,5 @@ /* Hierarchical argument parsing, layered over getopt - Copyright (C) 1995-2017 Free Software Foundation, Inc. + Copyright (C) 1995-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . diff --git a/gnu/argp-pin.c b/gnu/argp-pin.c index 7c05d1dd5ca77bec000ed8b1437350ba34ef79de..ece7423e3026e0be28c021900ff3633616c7e206 100644 --- a/gnu/argp-pin.c +++ b/gnu/argp-pin.c @@ -1,5 +1,5 @@ /* Full and short program names for argp module - Copyright (C) 2005, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2005, 2009-2019 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 diff --git a/gnu/argp-pv.c b/gnu/argp-pv.c index 000bbb2187d7467535d88146c4a641989281bf8c..f76b365add31f5be5b0133097dc667715f917d60 100644 --- a/gnu/argp-pv.c +++ b/gnu/argp-pv.c @@ -1,5 +1,5 @@ /* Default definition for ARGP_PROGRAM_VERSION. - Copyright (C) 1996-2017 Free Software Foundation, Inc. + Copyright (C) 1996-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . diff --git a/gnu/argp-pvh.c b/gnu/argp-pvh.c index c25d5c4b9c5736007001bb5990c1e92c970491f1..be73e335ff99544928c7eb9370a84f2ce940139e 100644 --- a/gnu/argp-pvh.c +++ b/gnu/argp-pvh.c @@ -1,5 +1,5 @@ /* Default definition for ARGP_PROGRAM_VERSION_HOOK. - Copyright (C) 1996-2017 Free Software Foundation, Inc. + Copyright (C) 1996-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . diff --git a/gnu/argp-version-etc.c b/gnu/argp-version-etc.c index 7562fb968c070086cb1a29a1b1158fd48eca8f19..0c7e0af7e28084fa307094ad7435073e2bd86291 100644 --- a/gnu/argp-version-etc.c +++ b/gnu/argp-version-etc.c @@ -1,5 +1,5 @@ /* Version hook for Argp. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/argp-version-etc.h b/gnu/argp-version-etc.h index 0b8969d3d87d60d660be58cfb37e110ef0d9131c..b9a1d2eb5ce30f52e53b323da4296c993f89d516 100644 --- a/gnu/argp-version-etc.h +++ b/gnu/argp-version-etc.h @@ -1,5 +1,5 @@ /* Version hook for Argp. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/argp-xinl.c b/gnu/argp-xinl.c index cfaf996b0eb55cec46243da368098d49d94e1b37..ebc032f6fb3c340a2619dcd975bd8e0942562d9f 100644 --- a/gnu/argp-xinl.c +++ b/gnu/argp-xinl.c @@ -1,5 +1,5 @@ /* Real definitions for extern inline functions in argp.h - Copyright (C) 1997-2017 Free Software Foundation, Inc. + Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . diff --git a/gnu/argp.h b/gnu/argp.h index 19813c8506da9ee2351c60744c9a331d334aa580..317ac034e01f93ba37f3ac7c785027dd6ebfbc05 100644 --- a/gnu/argp.h +++ b/gnu/argp.h @@ -1,5 +1,5 @@ /* Hierarchical argument parsing, layered over getopt. - Copyright (C) 1995-2017 Free Software Foundation, Inc. + Copyright (C) 1995-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . diff --git a/gnu/asnprintf.c b/gnu/asnprintf.c index b0a01fcbd1b03172a4195557f09373a221223bf9..d2a8c097205256735722d25e829052b3ea5865a4 100644 --- a/gnu/asnprintf.c +++ b/gnu/asnprintf.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 1999, 2002, 2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2006, 2009-2019 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 diff --git a/gnu/asprintf.c b/gnu/asprintf.c index 00bb9d743a9019365491b7f78787839bc4dbc3f9..6cbd062929e006c56ac909d756db5114cdc18370 100644 --- a/gnu/asprintf.c +++ b/gnu/asprintf.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 1999, 2002, 2006-2007, 2009-2017 Free Software Foundation, + Copyright (C) 1999, 2002, 2006-2007, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/gnu/assure.h b/gnu/assure.h index 342b126cb2dbedde4714fc43917a93b62fb78cd9..c21b6a6b806f598c862c574b7863f04fa36d44e4 100644 --- a/gnu/assure.h +++ b/gnu/assure.h @@ -1,6 +1,6 @@ /* Run-time assert-like macros. - Copyright (C) 2014-2017 Free Software Foundation, Inc. + Copyright (C) 2014-2019 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 @@ -23,7 +23,7 @@ #include /* Check E's value at runtime, and report an error and abort if not. - However, do nothng if NDEBUG is defined. + However, do nothing if NDEBUG is defined. Unlike standard 'assert', this macro always compiles E even when NDEBUG is defined, so as to catch typos and avoid some GCC warnings. */ diff --git a/gnu/at-func.c b/gnu/at-func.c index 2a3e375e9a2d0e3f0247dbc04b8039701a9a70ef..d2e63191afeaa76ce758b925386ec7b11c819e42 100644 --- a/gnu/at-func.c +++ b/gnu/at-func.c @@ -1,5 +1,5 @@ /* Define at-style functions like fstatat, unlinkat, fchownat, etc. - Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2019 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 diff --git a/gnu/at-func2.c b/gnu/at-func2.c index fbf3f6cba29c3382a6b30151193782a4e10b5dcf..eaa256cb1e646006531e7b74730c2b546bf651a2 100644 --- a/gnu/at-func2.c +++ b/gnu/at-func2.c @@ -1,5 +1,5 @@ /* Define 2-FD at-style functions like linkat or renameat. - Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2019 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 diff --git a/gnu/backup-find.c b/gnu/backup-find.c index 4c087414260dbd39b09b29c4ea7c964dfdadb1b3..c038ae6dcf49d74d220fee4828af95c934603945 100644 --- a/gnu/backup-find.c +++ b/gnu/backup-find.c @@ -1,6 +1,6 @@ /* backupfile.c -- make Emacs style backup file names - Copyright 2017 Free Software Foundation, Inc. + Copyright 2017-2019 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 @@ -24,14 +24,16 @@ #include -/* Return the name of a backup file for the existing file FILE, - allocated with malloc. Report an error and exit if out of memory. - Do not call this function if backup_type == no_backups. */ +/* Relative to DIR_FD, return the name of a backup file for the + existing file FILE, allocated with malloc. Report an error and + exit if out of memory. Do not call this function if + backup_type == no_backups. */ char * -find_backup_file_name (char const *file, enum backup_type backup_type) +find_backup_file_name (int dir_fd, char const *file, + enum backup_type backup_type) { - char *result = backupfile_internal (file, backup_type, false); + char *result = backupfile_internal (dir_fd, file, backup_type, false); if (!result) xalloc_die (); return result; diff --git a/gnu/backup-internal.h b/gnu/backup-internal.h index 2401c07b09023a46cb017d4876234d6a6f0fa1d0..17714b2d4a8c31ae55e9cd3d9a9610f7c0f812ad 100644 --- a/gnu/backup-internal.h +++ b/gnu/backup-internal.h @@ -1,3 +1,3 @@ #include "backupfile.h" #include -extern char *backupfile_internal (char const *, enum backup_type, bool); +extern char *backupfile_internal (int, char const *, enum backup_type, bool); diff --git a/gnu/backupfile.c b/gnu/backupfile.c index 22f54d3322568199b9f26ae5c1d22e00877f2e87..254c086145f0c0dddda97c649ecf2f8c2784eae3 100644 --- a/gnu/backupfile.c +++ b/gnu/backupfile.c @@ -1,6 +1,6 @@ /* backupfile.c -- make Emacs style backup file names - Copyright (C) 1990-2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1990-2006, 2009-2019 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 @@ -23,20 +23,26 @@ #include "backup-internal.h" #include "dirname.h" -#include "renameat2.h" +#include "opendirat.h" +#include "renameatu.h" #include "xalloc-oversized.h" -#include #include +#include #include +#include #include #include - -#include - #include -#include "dirent--.h" +#ifndef FALLTHROUGH +# if __GNUC__ < 7 +# define FALLTHROUGH ((void) 0) +# else +# define FALLTHROUGH __attribute__ ((__fallthrough__)) +# endif +#endif + #ifndef _D_EXACT_NAMLEN # define _D_EXACT_NAMLEN(dp) strlen ((dp)->d_name) #endif @@ -48,9 +54,6 @@ #ifndef _POSIX_NAME_MAX # define _POSIX_NAME_MAX 14 #endif -#ifndef SIZE_MAX -# define SIZE_MAX ((size_t) -1) -#endif #if defined _XOPEN_NAME_MAX # define NAME_MAX_MINIMUM _XOPEN_NAME_MAX @@ -92,10 +95,15 @@ set_simple_backup_suffix (char const *s) /* If FILE (which was of length FILELEN before an extension was appended to it) is too long, replace the extension with the single char E. If the result is still too long, remove the char just - before E. */ + before E. + + If DIR_FD is nonnegative, it is a file descriptor for FILE's parent. + *NAME_MAX is either 0, or the cached result of a previous call for + FILE's parent's _PC_NAME_MAX. */ static void -check_extension (char *file, size_t filelen, char e) +check_extension (char *file, size_t filelen, char e, + int dir_fd, size_t *base_max) { char *base = last_component (file); size_t baselen = base_len (base); @@ -104,22 +112,34 @@ check_extension (char *file, size_t filelen, char e) if (HAVE_DOS_FILE_NAMES || NAME_MAX_MINIMUM < baselen) { /* The new base name is long enough to require a pathconf check. */ - long name_max; - - /* Temporarily modify the buffer into its parent directory name, - invoke pathconf on the directory, and then restore the buffer. */ - char tmp[sizeof "."]; - memcpy (tmp, base, sizeof "."); - strcpy (base, "."); - errno = 0; - name_max = pathconf (file, _PC_NAME_MAX); - if (0 <= name_max || errno == 0) + if (*base_max == 0) { - long size = baselen_max = name_max; - if (name_max != size) - baselen_max = SIZE_MAX; + long name_max; + if (dir_fd < 0) + { + /* Temporarily modify the buffer into its parent + directory name, invoke pathconf on the directory, and + then restore the buffer. */ + char tmp[sizeof "."]; + memcpy (tmp, base, sizeof "."); + strcpy (base, "."); + errno = 0; + name_max = pathconf (file, _PC_NAME_MAX); + name_max -= !errno; + memcpy (base, tmp, sizeof "."); + } + else + { + errno = 0; + name_max = fpathconf (dir_fd, _PC_NAME_MAX); + name_max -= !errno; + } + + *base_max = (0 <= name_max && name_max <= SIZE_MAX ? name_max + : name_max < -1 ? NAME_MAX_MINIMUM : SIZE_MAX); } - memcpy (base, tmp, sizeof "."); + + baselen_max = *base_max; } if (HAVE_DOS_FILE_NAMES && baselen_max <= 12) @@ -167,8 +187,9 @@ enum numbered_backup_result BACKUP_NOMEM }; -/* *BUFFER contains a file name. Store into *BUFFER the next backup - name for the named file, with a version number greater than all the +/* Relative to DIR_FD, *BUFFER contains a file name. + Store into *BUFFER the next backup name for the named file, + with a version number greater than all the existing numbered backups. Reallocate *BUFFER as necessary; its initial allocated size is BUFFER_SIZE, which must be at least 4 bytes longer than the file name to make room for the initially @@ -180,11 +201,11 @@ enum numbered_backup_result *DIRPP is the destination directory. If *DIRPP is null, open the destination directory and store the resulting stream into *DIRPP - without closing the stream. */ + and its file descriptor into *PNEW_FD without closing the stream. */ static enum numbered_backup_result -numbered_backup (char **buffer, size_t buffer_size, size_t filelen, - ptrdiff_t base_offset, DIR **dirpp) +numbered_backup (int dir_fd, char **buffer, size_t buffer_size, size_t filelen, + ptrdiff_t base_offset, DIR **dirpp, int *pnew_fd) { enum numbered_backup_result result = BACKUP_IS_NEW; DIR *dirp = *dirpp; @@ -203,7 +224,7 @@ numbered_backup (char **buffer, size_t buffer_size, size_t filelen, char tmp[sizeof "."]; memcpy (tmp, base, sizeof "."); strcpy (base, "."); - dirp = opendir (buf); + dirp = opendirat (dir_fd, buf, 0, pnew_fd); if (!dirp && errno == ENOMEM) result = BACKUP_NOMEM; memcpy (base, tmp, sizeof "."); @@ -283,13 +304,15 @@ numbered_backup (char **buffer, size_t buffer_size, size_t filelen, return result; } -/* Return the name of the new backup file for the existing file FILE, - allocated with malloc. If RENAME, also rename FILE to the new name. +/* Relative to DIR_FD, return the name of the new backup file for the + existing file FILE, allocated with malloc. + If RENAME, also rename FILE to the new name. On failure, return NULL and set errno. Do not call this function if backup_type == no_backups. */ char * -backupfile_internal (char const *file, enum backup_type backup_type, bool rename) +backupfile_internal (int dir_fd, char const *file, + enum backup_type backup_type, bool rename) { ptrdiff_t base_offset = last_component (file) - file; size_t filelen = base_offset + strlen (file + base_offset); @@ -311,6 +334,8 @@ backupfile_internal (char const *file, enum backup_type backup_type, bool rename return s; DIR *dirp = NULL; + int sdir = -1; + size_t base_max = 0; while (true) { memcpy (s, file, filelen + 1); @@ -318,7 +343,8 @@ backupfile_internal (char const *file, enum backup_type backup_type, bool rename if (backup_type == simple_backups) memcpy (s + filelen, simple_backup_suffix, simple_backup_suffix_size); else - switch (numbered_backup (&s, ssize, filelen, base_offset, &dirp)) + switch (numbered_backup (dir_fd, &s, ssize, filelen, base_offset, + &dirp, &sdir)) { case BACKUP_IS_SAME_LENGTH: break; @@ -330,11 +356,9 @@ backupfile_internal (char const *file, enum backup_type backup_type, bool rename memcpy (s + filelen, simple_backup_suffix, simple_backup_suffix_size); } - check_extension (s, filelen, '~'); - break; - + FALLTHROUGH; case BACKUP_IS_LONGER: - check_extension (s, filelen, '~'); + check_extension (s, filelen, '~', sdir, &base_max); break; case BACKUP_NOMEM: @@ -346,14 +370,13 @@ backupfile_internal (char const *file, enum backup_type backup_type, bool rename if (! rename) break; - int sdir = dirp ? dirfd (dirp) : -1; if (sdir < 0) { sdir = AT_FDCWD; base_offset = 0; } unsigned flags = backup_type == simple_backups ? 0 : RENAME_NOREPLACE; - if (renameat2 (AT_FDCWD, file, sdir, s + base_offset, flags) == 0) + if (renameatu (AT_FDCWD, file, sdir, s + base_offset, flags) == 0) break; int e = errno; if (e != EEXIST) diff --git a/gnu/backupfile.h b/gnu/backupfile.h index c1c51c16c6106aff2ac70ff58f80328c51894bb3..beb968547b927179ed0b9a35a7eb7f5a1a54ed31 100644 --- a/gnu/backupfile.h +++ b/gnu/backupfile.h @@ -1,6 +1,6 @@ /* backupfile.h -- declarations for making Emacs style backup file names - Copyright (C) 1990-1992, 1997-1999, 2003-2004, 2009-2017 Free Software + Copyright (C) 1990-1992, 1997-1999, 2003-2004, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -17,11 +17,13 @@ along with this program. If not, see . */ #ifndef BACKUPFILE_H_ -# define BACKUPFILE_H_ +#define BACKUPFILE_H_ -# ifdef __cplusplus +#include + +#ifdef __cplusplus extern "C" { -# endif +#endif /* When to make backup files. */ @@ -41,21 +43,20 @@ enum backup_type numbered_backups }; -# define VALID_BACKUP_TYPE(Type) \ +#define VALID_BACKUP_TYPE(Type) \ ((unsigned int) (Type) <= numbered_backups) extern char const *simple_backup_suffix; void set_simple_backup_suffix (char const *); -char *backup_file_rename (char const *, enum backup_type); -char *find_backup_file_name (char const *, enum backup_type); +char *backup_file_rename (int, char const *, enum backup_type); +char *find_backup_file_name (int, char const *, enum backup_type); enum backup_type get_version (char const *context, char const *arg); enum backup_type xget_version (char const *context, char const *arg); -void addext (char *, char const *, int); -# ifdef __cplusplus +#ifdef __cplusplus } -# endif +#endif #endif /* ! BACKUPFILE_H_ */ diff --git a/gnu/basename-lgpl.c b/gnu/basename-lgpl.c index e760df00d7f2b8b5f10ec05386e05473267d458f..0ae04ee5722bc7c9405e13e3ac09a4491e9d3afd 100644 --- a/gnu/basename-lgpl.c +++ b/gnu/basename-lgpl.c @@ -1,6 +1,6 @@ /* basename.c -- return the last element in a file name - Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2017 Free Software + Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/basename.c b/gnu/basename.c index 8ed46f23dc770329fcee6dfbd66cd1c528f99fd1..1b6e0ea59bd7edff75fcbd5b6769a81a8050ad95 100644 --- a/gnu/basename.c +++ b/gnu/basename.c @@ -1,6 +1,6 @@ /* basename.c -- return the last element in a file name - Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2017 Free Software + Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/bitrotate.h b/gnu/bitrotate.h index 1e25f753fbd85ea98e6974aa64439b03664c092c..862331e204b2611db52dbd2939845e8b4feea3b1 100644 --- a/gnu/bitrotate.h +++ b/gnu/bitrotate.h @@ -1,5 +1,5 @@ /* bitrotate.h - Rotate bits in integers - Copyright (C) 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2008-2019 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 diff --git a/gnu/btowc.c b/gnu/btowc.c index fa908b41d81fc9816dd32086b4723c6fc0ab84fa..9e2496d40212327f8b1589062266d857904de789 100644 --- a/gnu/btowc.c +++ b/gnu/btowc.c @@ -1,5 +1,5 @@ /* Convert unibyte character to wide character. - Copyright (C) 2008, 2010-2017 Free Software Foundation, Inc. + Copyright (C) 2008, 2010-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify diff --git a/gnu/c++defs.h b/gnu/c++defs.h index 09dcd3e0687114f52a47dd304b200b9775d7e252..87d0716723eefca93d243b6097ad9a8b8a485650 100644 --- a/gnu/c++defs.h +++ b/gnu/c++defs.h @@ -1,5 +1,5 @@ /* C++ compatible function declaration macros. - Copyright (C) 2010-2017 Free Software Foundation, Inc. + Copyright (C) 2010-2019 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 diff --git a/gnu/c-ctype.h b/gnu/c-ctype.h index 9ad3c18d471778828efa40ea68e4ae26f97cbf10..4d521763843f3a82d940b33046bdb55ae4dad7ad 100644 --- a/gnu/c-ctype.h +++ b/gnu/c-ctype.h @@ -5,7 +5,7 @@ functions' behaviour depends on the current locale set via setlocale. - Copyright (C) 2000-2003, 2006, 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2006, 2008-2019 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 diff --git a/gnu/c-strcase.h b/gnu/c-strcase.h index 220d21d34ec207d707f4c241bd67c7fc2a089fe7..b67c9b5da0e35146e23862dfc8c46fd1edd7089b 100644 --- a/gnu/c-strcase.h +++ b/gnu/c-strcase.h @@ -1,5 +1,5 @@ /* Case-insensitive string comparison functions in C locale. - Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2017 Free Software + Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/gnu/c-strcasecmp.c b/gnu/c-strcasecmp.c index b2880a2e6c7de6896993b4fa9683170ea60bc8e4..ec50f1abe763d51530a95795b86ff19e87763a09 100644 --- a/gnu/c-strcasecmp.c +++ b/gnu/c-strcasecmp.c @@ -1,5 +1,5 @@ /* c-strcasecmp.c -- case insensitive string comparator in C locale - Copyright (C) 1998-1999, 2005-2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1998-1999, 2005-2006, 2009-2019 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 diff --git a/gnu/c-strcaseeq.h b/gnu/c-strcaseeq.h index 1f70e265c009083de41f4670eb2dad826223e78d..bcc81fc388dbe8555291c8ca7884e941c3049a61 100644 --- a/gnu/c-strcaseeq.h +++ b/gnu/c-strcaseeq.h @@ -1,5 +1,5 @@ /* Optimized case-insensitive string comparison in C locale. - Copyright (C) 2001-2002, 2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2007, 2009-2019 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 diff --git a/gnu/c-strncasecmp.c b/gnu/c-strncasecmp.c index 982e17915bc29a540a3c59fbe2e28a5e6caa1d3b..513c353f6c289be3428b363600f861cf04be6671 100644 --- a/gnu/c-strncasecmp.c +++ b/gnu/c-strncasecmp.c @@ -1,5 +1,5 @@ /* c-strncasecmp.c -- case insensitive string comparator in C locale - Copyright (C) 1998-1999, 2005-2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1998-1999, 2005-2006, 2009-2019 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 diff --git a/gnu/canonicalize-lgpl.c b/gnu/canonicalize-lgpl.c index cd3396dbd2c3d20ce87331e24b8b302cded21482..4d1be6dc24b4d0a1f8005fb2d80597d33c6d2b93 100644 --- a/gnu/canonicalize-lgpl.c +++ b/gnu/canonicalize-lgpl.c @@ -1,5 +1,5 @@ /* Return the canonical absolute name of a given file. - Copyright (C) 1996-2017 Free Software Foundation, Inc. + Copyright (C) 1996-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify @@ -95,7 +95,7 @@ static void alloc_failed (void) { -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ /* Avoid errno problem without using the malloc or realloc modules; see: https://lists.gnu.org/r/bug-gnulib/2016-08/msg00025.html */ errno = ENOMEM; diff --git a/gnu/careadlinkat.c b/gnu/careadlinkat.c index e2af54f0984604a7370e0389ae109d69a8dea563..e56d5030856ed3ed504ace8c02ba4eb96cd6fdf3 100644 --- a/gnu/careadlinkat.c +++ b/gnu/careadlinkat.c @@ -1,6 +1,6 @@ /* Read symbolic links into a buffer without size limitation, relative to fd. - Copyright (C) 2001, 2003-2004, 2007, 2009-2017 Free Software Foundation, + Copyright (C) 2001, 2003-2004, 2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/careadlinkat.h b/gnu/careadlinkat.h index d436c691eaa91bb1aa3bdd7430c7a8cb61b81554..68b69aa88939fba5498d8a46e5c31da690cb13b9 100644 --- a/gnu/careadlinkat.h +++ b/gnu/careadlinkat.h @@ -1,6 +1,6 @@ /* Read symbolic links into a buffer without size limitation, relative to fd. - Copyright (C) 2011-2017 Free Software Foundation, Inc. + Copyright (C) 2011-2019 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 diff --git a/gnu/cdefs.h b/gnu/cdefs.h new file mode 100644 index 0000000000000000000000000000000000000000..f7a106440640d114f9cc4e1c4bb444e2b301c22b --- /dev/null +++ b/gnu/cdefs.h @@ -0,0 +1,514 @@ +/* Copyright (C) 1992-2019 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_CDEFS_H +#define _SYS_CDEFS_H 1 + +/* We are almost always included from features.h. */ +#ifndef _FEATURES_H +# include +#endif + +/* The GNU libc does not support any K&R compilers or the traditional mode + of ISO C compilers anymore. Check for some of the combinations not + anymore supported. */ +#if defined __GNUC__ && !defined __STDC__ +# error "You need a ISO C conforming compiler to use the glibc headers" +#endif + +/* Some user header file might have defined this before. */ +#undef __P +#undef __PMT + +#ifdef __GNUC__ + +/* All functions, except those with callbacks or those that + synchronize memory, are leaf functions. */ +# if __GNUC_PREREQ (4, 6) && !defined _LIBC +# define __LEAF , __leaf__ +# define __LEAF_ATTR __attribute__ ((__leaf__)) +# else +# define __LEAF +# define __LEAF_ATTR +# endif + +/* GCC can always grok prototypes. For C++ programs we add throw() + to help it optimize the function calls. But this works only with + gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions + as non-throwing using a function attribute since programs can use + the -fexceptions options for C code as well. */ +# if !defined __cplusplus && __GNUC_PREREQ (3, 3) +# define __THROW __attribute__ ((__nothrow__ __LEAF)) +# define __THROWNL __attribute__ ((__nothrow__)) +# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct +# define __NTHNL(fct) __attribute__ ((__nothrow__)) fct +# else +# if defined __cplusplus && __GNUC_PREREQ (2,8) +# define __THROW throw () +# define __THROWNL throw () +# define __NTH(fct) __LEAF_ATTR fct throw () +# define __NTHNL(fct) fct throw () +# else +# define __THROW +# define __THROWNL +# define __NTH(fct) fct +# define __NTHNL(fct) fct +# endif +# endif + +#else /* Not GCC. */ + +# if (defined __cplusplus \ + || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) +# define __inline inline +# else +# define __inline /* No inline functions. */ +# endif + +# define __THROW +# define __THROWNL +# define __NTH(fct) fct + +#endif /* GCC. */ + +/* Compilers that are not clang may object to + #if defined __clang__ && __has_extension(...) + even though they do not need to evaluate the right-hand side of the &&. */ +#if defined __clang__ && defined __has_extension +# define __glibc_clang_has_extension(ext) __has_extension (ext) +#else +# define __glibc_clang_has_extension(ext) 0 +#endif + +/* These two macros are not used in glibc anymore. They are kept here + only because some other projects expect the macros to be defined. */ +#define __P(args) args +#define __PMT(args) args + +/* For these things, GCC behaves the ANSI way normally, + and the non-ANSI way under -traditional. */ + +#define __CONCAT(x,y) x ## y +#define __STRING(x) #x + +/* This is not a typedef so `const __ptr_t' does the right thing. */ +#define __ptr_t void * + + +/* C++ needs to know that types and declarations are C, not C++. */ +#ifdef __cplusplus +# define __BEGIN_DECLS extern "C" { +# define __END_DECLS } +#else +# define __BEGIN_DECLS +# define __END_DECLS +#endif + + +/* Fortify support. */ +#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) +#define __bos0(ptr) __builtin_object_size (ptr, 0) + +#if __GNUC_PREREQ (4,3) +# define __warndecl(name, msg) \ + extern void name (void) __attribute__((__warning__ (msg))) +# define __warnattr(msg) __attribute__((__warning__ (msg))) +# define __errordecl(name, msg) \ + extern void name (void) __attribute__((__error__ (msg))) +#else +# define __warndecl(name, msg) extern void name (void) +# define __warnattr(msg) +# define __errordecl(name, msg) extern void name (void) +#endif + +/* Support for flexible arrays. + Headers that should use flexible arrays only if they're "real" + (e.g. only if they won't affect sizeof()) should test + #if __glibc_c99_flexarr_available. */ +#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc +# define __flexarr [] +# define __glibc_c99_flexarr_available 1 +#elif __GNUC_PREREQ (2,97) +/* GCC 2.97 supports C99 flexible array members as an extension, + even when in C89 mode or compiling C++ (any version). */ +# define __flexarr [] +# define __glibc_c99_flexarr_available 1 +#elif defined __GNUC__ +/* Pre-2.97 GCC did not support C99 flexible arrays but did have + an equivalent extension with slightly different notation. */ +# define __flexarr [0] +# define __glibc_c99_flexarr_available 1 +#else +/* Some other non-C99 compiler. Approximate with [1]. */ +# define __flexarr [1] +# define __glibc_c99_flexarr_available 0 +#endif + + +/* __asm__ ("xyz") is used throughout the headers to rename functions + at the assembly language level. This is wrapped by the __REDIRECT + macro, in order to support compilers that can do this some other + way. When compilers don't support asm-names at all, we have to do + preprocessor tricks instead (which don't have exactly the right + semantics, but it's the best we can do). + + Example: + int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ + +#if defined __GNUC__ && __GNUC__ >= 2 + +# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) +# ifdef __cplusplus +# define __REDIRECT_NTH(name, proto, alias) \ + name proto __THROW __asm__ (__ASMNAME (#alias)) +# define __REDIRECT_NTHNL(name, proto, alias) \ + name proto __THROWNL __asm__ (__ASMNAME (#alias)) +# else +# define __REDIRECT_NTH(name, proto, alias) \ + name proto __asm__ (__ASMNAME (#alias)) __THROW +# define __REDIRECT_NTHNL(name, proto, alias) \ + name proto __asm__ (__ASMNAME (#alias)) __THROWNL +# endif +# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) +# define __ASMNAME2(prefix, cname) __STRING (prefix) cname + +/* +#elif __SOME_OTHER_COMPILER__ + +# define __REDIRECT(name, proto, alias) name proto; \ + _Pragma("let " #name " = " #alias) +*/ +#endif + +/* GCC has various useful declarations that can be made with the + `__attribute__' syntax. All of the ways we use this do fine if + they are omitted for compilers that don't understand it. */ +#if !defined __GNUC__ || __GNUC__ < 2 +# define __attribute__(xyz) /* Ignore */ +#endif + +/* At some point during the gcc 2.96 development the `malloc' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. */ +#if __GNUC_PREREQ (2,96) +# define __attribute_malloc__ __attribute__ ((__malloc__)) +#else +# define __attribute_malloc__ /* Ignore */ +#endif + +/* Tell the compiler which arguments to an allocation function + indicate the size of the allocation. */ +#if __GNUC_PREREQ (4, 3) +# define __attribute_alloc_size__(params) \ + __attribute__ ((__alloc_size__ params)) +#else +# define __attribute_alloc_size__(params) /* Ignore. */ +#endif + +/* At some point during the gcc 2.96 development the `pure' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. */ +#if __GNUC_PREREQ (2,96) +# define __attribute_pure__ __attribute__ ((__pure__)) +#else +# define __attribute_pure__ /* Ignore */ +#endif + +/* This declaration tells the compiler that the value is constant. */ +#if __GNUC_PREREQ (2,5) +# define __attribute_const__ __attribute__ ((__const__)) +#else +# define __attribute_const__ /* Ignore */ +#endif + +/* At some point during the gcc 3.1 development the `used' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. */ +#if __GNUC_PREREQ (3,1) +# define __attribute_used__ __attribute__ ((__used__)) +# define __attribute_noinline__ __attribute__ ((__noinline__)) +#else +# define __attribute_used__ __attribute__ ((__unused__)) +# define __attribute_noinline__ /* Ignore */ +#endif + +/* Since version 3.2, gcc allows marking deprecated functions. */ +#if __GNUC_PREREQ (3,2) +# define __attribute_deprecated__ __attribute__ ((__deprecated__)) +#else +# define __attribute_deprecated__ /* Ignore */ +#endif + +/* Since version 4.5, gcc also allows one to specify the message printed + when a deprecated function is used. clang claims to be gcc 4.2, but + may also support this feature. */ +#if __GNUC_PREREQ (4,5) || \ + __glibc_clang_has_extension (__attribute_deprecated_with_message__) +# define __attribute_deprecated_msg__(msg) \ + __attribute__ ((__deprecated__ (msg))) +#else +# define __attribute_deprecated_msg__(msg) __attribute_deprecated__ +#endif + +/* At some point during the gcc 2.8 development the `format_arg' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. + If several `format_arg' attributes are given for the same function, in + gcc-3.0 and older, all but the last one are ignored. In newer gccs, + all designated arguments are considered. */ +#if __GNUC_PREREQ (2,8) +# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) +#else +# define __attribute_format_arg__(x) /* Ignore */ +#endif + +/* At some point during the gcc 2.97 development the `strfmon' format + attribute for functions was introduced. We don't want to use it + unconditionally (although this would be possible) since it + generates warnings. */ +#if __GNUC_PREREQ (2,97) +# define __attribute_format_strfmon__(a,b) \ + __attribute__ ((__format__ (__strfmon__, a, b))) +#else +# define __attribute_format_strfmon__(a,b) /* Ignore */ +#endif + +/* The nonnull function attribute marks pointer parameters that + must not be NULL. Do not define __nonnull if it is already defined, + for portability when this file is used in Gnulib. */ +#ifndef __nonnull +# if __GNUC_PREREQ (3,3) +# define __nonnull(params) __attribute__ ((__nonnull__ params)) +# else +# define __nonnull(params) +# endif +#endif + +/* If fortification mode, we warn about unused results of certain + function calls which can lead to problems. */ +#if __GNUC_PREREQ (3,4) +# define __attribute_warn_unused_result__ \ + __attribute__ ((__warn_unused_result__)) +# if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0 +# define __wur __attribute_warn_unused_result__ +# endif +#else +# define __attribute_warn_unused_result__ /* empty */ +#endif +#ifndef __wur +# define __wur /* Ignore */ +#endif + +/* Forces a function to be always inlined. */ +#if __GNUC_PREREQ (3,2) +/* The Linux kernel defines __always_inline in stddef.h (283d7573), and + it conflicts with this definition. Therefore undefine it first to + allow either header to be included first. */ +# undef __always_inline +# define __always_inline __inline __attribute__ ((__always_inline__)) +#else +# undef __always_inline +# define __always_inline __inline +#endif + +/* Associate error messages with the source location of the call site rather + than with the source location inside the function. */ +#if __GNUC_PREREQ (4,3) +# define __attribute_artificial__ __attribute__ ((__artificial__)) +#else +# define __attribute_artificial__ /* Ignore */ +#endif + +/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 + inline semantics, unless -fgnu89-inline is used. Using __GNUC_STDC_INLINE__ + or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions + older than 4.3 may define these macros and still not guarantee GNU inlining + semantics. + + clang++ identifies itself as gcc-4.2, but has support for GNU inlining + semantics, that can be checked fot by using the __GNUC_STDC_INLINE_ and + __GNUC_GNU_INLINE__ macro definitions. */ +#if (!defined __cplusplus || __GNUC_PREREQ (4,3) \ + || (defined __clang__ && (defined __GNUC_STDC_INLINE__ \ + || defined __GNUC_GNU_INLINE__))) +# if defined __GNUC_STDC_INLINE__ || defined __cplusplus +# define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) +# define __extern_always_inline \ + extern __always_inline __attribute__ ((__gnu_inline__)) +# else +# define __extern_inline extern __inline +# define __extern_always_inline extern __always_inline +# endif +#endif + +#ifdef __extern_always_inline +# define __fortify_function __extern_always_inline __attribute_artificial__ +#endif + +/* GCC 4.3 and above allow passing all anonymous arguments of an + __extern_always_inline function to some other vararg function. */ +#if __GNUC_PREREQ (4,3) +# define __va_arg_pack() __builtin_va_arg_pack () +# define __va_arg_pack_len() __builtin_va_arg_pack_len () +#endif + +/* It is possible to compile containing GCC extensions even if GCC is + run in pedantic mode if the uses are carefully marked using the + `__extension__' keyword. But this is not generally available before + version 2.8. */ +#if !__GNUC_PREREQ (2,8) +# define __extension__ /* Ignore */ +#endif + +/* __restrict is known in EGCS 1.2 and above. */ +#if !__GNUC_PREREQ (2,92) +# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +# define __restrict restrict +# else +# define __restrict /* Ignore */ +# endif +#endif + +/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is + array_name[restrict] + GCC 3.1 supports this. */ +#if __GNUC_PREREQ (3,1) && !defined __GNUG__ +# define __restrict_arr __restrict +#else +# ifdef __GNUC__ +# define __restrict_arr /* Not supported in old GCC. */ +# else +# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +# define __restrict_arr restrict +# else +/* Some other non-C99 compiler. */ +# define __restrict_arr /* Not supported. */ +# endif +# endif +#endif + +#if __GNUC__ >= 3 +# define __glibc_unlikely(cond) __builtin_expect ((cond), 0) +# define __glibc_likely(cond) __builtin_expect ((cond), 1) +#else +# define __glibc_unlikely(cond) (cond) +# define __glibc_likely(cond) (cond) +#endif + +#ifdef __has_attribute +# define __glibc_has_attribute(attr) __has_attribute (attr) +#else +# define __glibc_has_attribute(attr) 0 +#endif + +#if (!defined _Noreturn \ + && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ + && !__GNUC_PREREQ (4,7)) +# if __GNUC_PREREQ (2,8) +# define _Noreturn __attribute__ ((__noreturn__)) +# else +# define _Noreturn +# endif +#endif + +#if __GNUC_PREREQ (8, 0) +/* Describes a char array whose address can safely be passed as the first + argument to strncpy and strncat, as the char array is not necessarily + a NUL-terminated string. */ +# define __attribute_nonstring__ __attribute__ ((__nonstring__)) +#else +# define __attribute_nonstring__ +#endif + +#if (!defined _Static_assert && !defined __cplusplus \ + && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ + && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__)) +# define _Static_assert(expr, diagnostic) \ + extern int (*__Static_assert_function (void)) \ + [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] +#endif + +/* The #ifndef lets Gnulib avoid including these on non-glibc + platforms, where the includes typically do not exist. */ +#ifndef __WORDSIZE +# include +# include +#endif + +#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH +# define __LDBL_COMPAT 1 +# ifdef __REDIRECT +# define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias) +# define __LDBL_REDIR(name, proto) \ + __LDBL_REDIR1 (name, proto, __nldbl_##name) +# define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias) +# define __LDBL_REDIR_NTH(name, proto) \ + __LDBL_REDIR1_NTH (name, proto, __nldbl_##name) +# define __LDBL_REDIR1_DECL(name, alias) \ + extern __typeof (name) name __asm (__ASMNAME (#alias)); +# define __LDBL_REDIR_DECL(name) \ + extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name)); +# define __REDIRECT_LDBL(name, proto, alias) \ + __LDBL_REDIR1 (name, proto, __nldbl_##alias) +# define __REDIRECT_NTH_LDBL(name, proto, alias) \ + __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) +# endif +#endif +#if !defined __LDBL_COMPAT || !defined __REDIRECT +# define __LDBL_REDIR1(name, proto, alias) name proto +# define __LDBL_REDIR(name, proto) name proto +# define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW +# define __LDBL_REDIR_NTH(name, proto) name proto __THROW +# define __LDBL_REDIR_DECL(name) +# ifdef __REDIRECT +# define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias) +# define __REDIRECT_NTH_LDBL(name, proto, alias) \ + __REDIRECT_NTH (name, proto, alias) +# endif +#endif + +/* __glibc_macro_warning (MESSAGE) issues warning MESSAGE. This is + intended for use in preprocessor macros. + + Note: MESSAGE must be a _single_ string; concatenation of string + literals is not supported. */ +#if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5) +# define __glibc_macro_warning1(message) _Pragma (#message) +# define __glibc_macro_warning(message) \ + __glibc_macro_warning1 (GCC warning message) +#else +# define __glibc_macro_warning(msg) +#endif + +/* Generic selection (ISO C11) is a C-only feature, available in GCC + since version 4.9. Previous versions do not provide generic + selection, even though they might set __STDC_VERSION__ to 201112L, + when in -std=c11 mode. Thus, we must check for !defined __GNUC__ + when testing __STDC_VERSION__ for generic selection support. + On the other hand, Clang also defines __GNUC__, so a clang-specific + check is required to enable the use of generic selection. */ +#if !defined __cplusplus \ + && (__GNUC_PREREQ (4, 9) \ + || __glibc_clang_has_extension (c_generic_selections) \ + || (!defined __GNUC__ && defined __STDC_VERSION__ \ + && __STDC_VERSION__ >= 201112L)) +# define __HAVE_GENERIC_SELECTION 1 +#else +# define __HAVE_GENERIC_SELECTION 0 +#endif + +#endif /* sys/cdefs.h */ diff --git a/gnu/chdir-long.c b/gnu/chdir-long.c index 7e2e63c966491395e0a7b2a74a242caae034ae75..febdf59d4ecf39c97befb407ac60b58eac40bb34 100644 --- a/gnu/chdir-long.c +++ b/gnu/chdir-long.c @@ -1,5 +1,5 @@ /* provide a chdir function that tries not to fail due to ENAMETOOLONG - Copyright (C) 2004-2017 Free Software Foundation, Inc. + Copyright (C) 2004-2019 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 diff --git a/gnu/chdir-long.h b/gnu/chdir-long.h index 3acd70db07b5a6f2e40d21a598fdf6f15252dcc4..43259d1b271537cd78c96fcca3c4b6e3492f8b2c 100644 --- a/gnu/chdir-long.h +++ b/gnu/chdir-long.h @@ -1,5 +1,5 @@ /* provide a chdir function that tries not to fail due to ENAMETOOLONG - Copyright (C) 2004-2005, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2004-2005, 2009-2019 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 diff --git a/gnu/chown.c b/gnu/chown.c index 37d1a1fba79caf05703031c7999ea82b6ffef327..fc73e778137aea71b97be3ce9784933f02574ea9 100644 --- a/gnu/chown.c +++ b/gnu/chown.c @@ -1,7 +1,7 @@ /* provide consistent interface to chown for systems that don't interpret an ID of -1 as meaning "don't change the corresponding ID". - Copyright (C) 1997, 2004-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1997, 2004-2007, 2009-2019 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 diff --git a/gnu/cloexec.c b/gnu/cloexec.c index 2b67a0102e74b3a759f0c77578770bfcfcc1f2be..db425766a0e1e5d0248bdfae9c81cea709102d1f 100644 --- a/gnu/cloexec.c +++ b/gnu/cloexec.c @@ -1,6 +1,6 @@ /* cloexec.c - set or clear the close-on-exec descriptor flag - Copyright (C) 1991, 2004-2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1991, 2004-2006, 2009-2019 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 diff --git a/gnu/cloexec.h b/gnu/cloexec.h index d937a40681741ea0e3ca764eb3da1f93d7b05775..06ad945d8e2aa272d082ac0b8971d8f8e83d0114 100644 --- a/gnu/cloexec.h +++ b/gnu/cloexec.h @@ -1,6 +1,6 @@ /* cloexec.c - set or clear the close-on-exec descriptor flag - Copyright (C) 2004, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2004, 2009-2019 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 diff --git a/gnu/close-stream.c b/gnu/close-stream.c index 19707626fa282778515f7b85bde8ed01f9096da2..5458c4f29f36f30dfbea11238ba1b954d704b27b 100644 --- a/gnu/close-stream.c +++ b/gnu/close-stream.c @@ -1,6 +1,6 @@ /* Close a stream, with nicer error checking than fclose's. - Copyright (C) 1998-2002, 2004, 2006-2017 Free Software Foundation, Inc. + Copyright (C) 1998-2002, 2004, 2006-2019 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 diff --git a/gnu/close.c b/gnu/close.c index 5b6bd3c7de13d8743ad1ab24737f509a1e7ada2c..40ce845bc33315ac9473a6b34562b7ce9a94af84 100644 --- a/gnu/close.c +++ b/gnu/close.c @@ -1,5 +1,5 @@ /* close replacement. - Copyright (C) 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2008-2019 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 diff --git a/gnu/closedir.c b/gnu/closedir.c index 6b5e78c6ea5866c11e2d2eebaabb4425a29d793b..017fb682ce99ca756c1ccfdbca6f0848a9f168e6 100644 --- a/gnu/closedir.c +++ b/gnu/closedir.c @@ -1,5 +1,5 @@ /* Stop reading the entries of a directory. - Copyright (C) 2006-2017 Free Software Foundation, Inc. + Copyright (C) 2006-2019 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 diff --git a/gnu/closeout.c b/gnu/closeout.c index 82cba4cd1af80e074f1748b758b320aff8d1da57..4a604ec35d4b2854580d2ff4d5d2c45fb16021a3 100644 --- a/gnu/closeout.c +++ b/gnu/closeout.c @@ -1,6 +1,6 @@ /* Close standard output and standard error, exiting with a diagnostic on error. - Copyright (C) 1998-2002, 2004, 2006, 2008-2017 Free Software Foundation, + Copyright (C) 1998-2002, 2004, 2006, 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/closeout.h b/gnu/closeout.h index fff76f11126ab1a7390752e5316c6f1b30640d2a..ac89f760a952691e3705d06e7d89f9a88eedac63 100644 --- a/gnu/closeout.h +++ b/gnu/closeout.h @@ -1,6 +1,6 @@ /* Close standard output and standard error. - Copyright (C) 1998, 2000, 2003-2004, 2006, 2008-2017 Free Software + Copyright (C) 1998, 2000, 2003-2004, 2006, 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/config.charset b/gnu/config.charset deleted file mode 100644 index e017fed4b54daee4eceec711ac2e6fc9bbff4b8b..0000000000000000000000000000000000000000 --- a/gnu/config.charset +++ /dev/null @@ -1,682 +0,0 @@ -#! /bin/sh -# Output a system dependent table of character encoding aliases. -# -# Copyright (C) 2000-2004, 2006-2017 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 -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# 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 . -# -# The table consists of lines of the form -# ALIAS CANONICAL -# -# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)". -# ALIAS is compared in a case sensitive way. -# -# CANONICAL is the GNU canonical name for this character encoding. -# It must be an encoding supported by libiconv. Support by GNU libc is -# also desirable. CANONICAL is case insensitive. Usually an upper case -# MIME charset name is preferred. -# The current list of GNU canonical charset names is as follows. -# -# name MIME? used by which systems -# (darwin = Mac OS X, woe32 = native Windows) -# -# ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin cygwin -# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin -# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin -# ISO-8859-3 Y glibc solaris cygwin -# ISO-8859-4 Y osf solaris freebsd netbsd openbsd darwin -# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin -# ISO-8859-6 Y glibc aix hpux solaris cygwin -# ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd openbsd darwin cygwin -# ISO-8859-8 Y glibc aix hpux osf solaris cygwin -# ISO-8859-9 Y glibc aix hpux irix osf solaris darwin cygwin -# ISO-8859-13 glibc netbsd openbsd darwin cygwin -# ISO-8859-14 glibc cygwin -# ISO-8859-15 glibc aix osf solaris freebsd netbsd openbsd darwin cygwin -# KOI8-R Y glibc solaris freebsd netbsd openbsd darwin -# KOI8-U Y glibc freebsd netbsd openbsd darwin cygwin -# KOI8-T glibc -# CP437 dos -# CP775 dos -# CP850 aix osf dos -# CP852 dos -# CP855 dos -# CP856 aix -# CP857 dos -# CP861 dos -# CP862 dos -# CP864 dos -# CP865 dos -# CP866 freebsd netbsd openbsd darwin dos -# CP869 dos -# CP874 woe32 dos -# CP922 aix -# CP932 aix cygwin woe32 dos -# CP943 aix -# CP949 osf darwin woe32 dos -# CP950 woe32 dos -# CP1046 aix -# CP1124 aix -# CP1125 dos -# CP1129 aix -# CP1131 darwin -# CP1250 woe32 -# CP1251 glibc solaris netbsd openbsd darwin cygwin woe32 -# CP1252 aix woe32 -# CP1253 woe32 -# CP1254 woe32 -# CP1255 glibc woe32 -# CP1256 woe32 -# CP1257 woe32 -# GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin -# EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin -# EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin -# EUC-TW glibc aix hpux irix osf solaris netbsd -# BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin cygwin -# BIG5-HKSCS glibc solaris darwin -# GBK glibc aix osf solaris darwin cygwin woe32 dos -# GB18030 glibc solaris netbsd darwin -# SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin -# JOHAB glibc solaris woe32 -# TIS-620 glibc aix hpux osf solaris cygwin -# VISCII Y glibc -# TCVN5712-1 glibc -# ARMSCII-8 glibc darwin -# GEORGIAN-PS glibc cygwin -# PT154 glibc -# HP-ROMAN8 hpux -# HP-ARABIC8 hpux -# HP-GREEK8 hpux -# HP-HEBREW8 hpux -# HP-TURKISH8 hpux -# HP-KANA8 hpux -# DEC-KANJI osf -# DEC-HANYU osf -# UTF-8 Y glibc aix hpux osf solaris netbsd darwin cygwin -# -# Note: Names which are not marked as being a MIME name should not be used in -# Internet protocols for information interchange (mail, news, etc.). -# -# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications -# must understand both names and treat them as equivalent. -# -# The first argument passed to this file is the canonical host specification, -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM - -host="$1" -os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'` -echo "# This file contains a table of character encoding aliases," -echo "# suitable for operating system '${os}'." -echo "# It was automatically generated from config.charset." -# List of references, updated during installation: -echo "# Packages using this file: " -case "$os" in - linux-gnulibc1*) - # Linux libc5 doesn't have nl_langinfo(CODESET); therefore - # localcharset.c falls back to using the full locale name - # from the environment variables. - echo "C ASCII" - echo "POSIX ASCII" - for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \ - en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \ - en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \ - es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \ - et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \ - fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \ - it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \ - sv_FI sv_SE; do - echo "$l ISO-8859-1" - echo "$l.iso-8859-1 ISO-8859-1" - echo "$l.iso-8859-15 ISO-8859-15" - echo "$l.iso-8859-15@euro ISO-8859-15" - echo "$l@euro ISO-8859-15" - echo "$l.cp-437 CP437" - echo "$l.cp-850 CP850" - echo "$l.cp-1252 CP1252" - echo "$l.cp-1252@euro CP1252" - #echo "$l.atari-st ATARI-ST" # not a commonly used encoding - echo "$l.utf-8 UTF-8" - echo "$l.utf-8@euro UTF-8" - done - for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \ - sl_SI sr sr_CS sr_YU; do - echo "$l ISO-8859-2" - echo "$l.iso-8859-2 ISO-8859-2" - echo "$l.cp-852 CP852" - echo "$l.cp-1250 CP1250" - echo "$l.utf-8 UTF-8" - done - for l in mk mk_MK ru ru_RU; do - echo "$l ISO-8859-5" - echo "$l.iso-8859-5 ISO-8859-5" - echo "$l.koi8-r KOI8-R" - echo "$l.cp-866 CP866" - echo "$l.cp-1251 CP1251" - echo "$l.utf-8 UTF-8" - done - for l in ar ar_SA; do - echo "$l ISO-8859-6" - echo "$l.iso-8859-6 ISO-8859-6" - echo "$l.cp-864 CP864" - #echo "$l.cp-868 CP868" # not a commonly used encoding - echo "$l.cp-1256 CP1256" - echo "$l.utf-8 UTF-8" - done - for l in el el_GR gr gr_GR; do - echo "$l ISO-8859-7" - echo "$l.iso-8859-7 ISO-8859-7" - echo "$l.cp-869 CP869" - echo "$l.cp-1253 CP1253" - echo "$l.cp-1253@euro CP1253" - echo "$l.utf-8 UTF-8" - echo "$l.utf-8@euro UTF-8" - done - for l in he he_IL iw iw_IL; do - echo "$l ISO-8859-8" - echo "$l.iso-8859-8 ISO-8859-8" - echo "$l.cp-862 CP862" - echo "$l.cp-1255 CP1255" - echo "$l.utf-8 UTF-8" - done - for l in tr tr_TR; do - echo "$l ISO-8859-9" - echo "$l.iso-8859-9 ISO-8859-9" - echo "$l.cp-857 CP857" - echo "$l.cp-1254 CP1254" - echo "$l.utf-8 UTF-8" - done - for l in lt lt_LT lv lv_LV; do - #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name - echo "$l ISO-8859-13" - done - for l in ru_UA uk uk_UA; do - echo "$l KOI8-U" - done - for l in zh zh_CN; do - #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name - echo "$l GB2312" - done - for l in ja ja_JP ja_JP.EUC; do - echo "$l EUC-JP" - done - for l in ko ko_KR; do - echo "$l EUC-KR" - done - for l in th th_TH; do - echo "$l TIS-620" - done - for l in fa fa_IR; do - #echo "$l ISIRI-3342" # a broken encoding - echo "$l.utf-8 UTF-8" - done - ;; - linux* | *-gnu*) - # With glibc-2.1 or newer, we don't need any canonicalization, - # because glibc has iconv and both glibc and libiconv support all - # GNU canonical names directly. Therefore, the Makefile does not - # need to install the alias file at all. - # The following applies only to glibc-2.0.x and older libcs. - echo "ISO_646.IRV:1983 ASCII" - ;; - aix*) - echo "ISO8859-1 ISO-8859-1" - echo "ISO8859-2 ISO-8859-2" - echo "ISO8859-5 ISO-8859-5" - echo "ISO8859-6 ISO-8859-6" - echo "ISO8859-7 ISO-8859-7" - echo "ISO8859-8 ISO-8859-8" - echo "ISO8859-9 ISO-8859-9" - echo "ISO8859-15 ISO-8859-15" - echo "IBM-850 CP850" - echo "IBM-856 CP856" - echo "IBM-921 ISO-8859-13" - echo "IBM-922 CP922" - echo "IBM-932 CP932" - echo "IBM-943 CP943" - echo "IBM-1046 CP1046" - echo "IBM-1124 CP1124" - echo "IBM-1129 CP1129" - echo "IBM-1252 CP1252" - echo "IBM-eucCN GB2312" - echo "IBM-eucJP EUC-JP" - echo "IBM-eucKR EUC-KR" - echo "IBM-eucTW EUC-TW" - echo "big5 BIG5" - echo "GBK GBK" - echo "TIS-620 TIS-620" - echo "UTF-8 UTF-8" - ;; - hpux*) - echo "iso88591 ISO-8859-1" - echo "iso88592 ISO-8859-2" - echo "iso88595 ISO-8859-5" - echo "iso88596 ISO-8859-6" - echo "iso88597 ISO-8859-7" - echo "iso88598 ISO-8859-8" - echo "iso88599 ISO-8859-9" - echo "iso885915 ISO-8859-15" - echo "roman8 HP-ROMAN8" - echo "arabic8 HP-ARABIC8" - echo "greek8 HP-GREEK8" - echo "hebrew8 HP-HEBREW8" - echo "turkish8 HP-TURKISH8" - echo "kana8 HP-KANA8" - echo "tis620 TIS-620" - echo "big5 BIG5" - echo "eucJP EUC-JP" - echo "eucKR EUC-KR" - echo "eucTW EUC-TW" - echo "hp15CN GB2312" - #echo "ccdc ?" # what is this? - echo "SJIS SHIFT_JIS" - echo "utf8 UTF-8" - ;; - irix*) - echo "ISO8859-1 ISO-8859-1" - echo "ISO8859-2 ISO-8859-2" - echo "ISO8859-5 ISO-8859-5" - echo "ISO8859-7 ISO-8859-7" - echo "ISO8859-9 ISO-8859-9" - echo "eucCN GB2312" - echo "eucJP EUC-JP" - echo "eucKR EUC-KR" - echo "eucTW EUC-TW" - ;; - osf*) - echo "ISO8859-1 ISO-8859-1" - echo "ISO8859-2 ISO-8859-2" - echo "ISO8859-4 ISO-8859-4" - echo "ISO8859-5 ISO-8859-5" - echo "ISO8859-7 ISO-8859-7" - echo "ISO8859-8 ISO-8859-8" - echo "ISO8859-9 ISO-8859-9" - echo "ISO8859-15 ISO-8859-15" - echo "cp850 CP850" - echo "big5 BIG5" - echo "dechanyu DEC-HANYU" - echo "dechanzi GB2312" - echo "deckanji DEC-KANJI" - echo "deckorean EUC-KR" - echo "eucJP EUC-JP" - echo "eucKR EUC-KR" - echo "eucTW EUC-TW" - echo "GBK GBK" - echo "KSC5601 CP949" - echo "sdeckanji EUC-JP" - echo "SJIS SHIFT_JIS" - echo "TACTIS TIS-620" - echo "UTF-8 UTF-8" - ;; - solaris*) - echo "646 ASCII" - echo "ISO8859-1 ISO-8859-1" - echo "ISO8859-2 ISO-8859-2" - echo "ISO8859-3 ISO-8859-3" - echo "ISO8859-4 ISO-8859-4" - echo "ISO8859-5 ISO-8859-5" - echo "ISO8859-6 ISO-8859-6" - echo "ISO8859-7 ISO-8859-7" - echo "ISO8859-8 ISO-8859-8" - echo "ISO8859-9 ISO-8859-9" - echo "ISO8859-15 ISO-8859-15" - echo "koi8-r KOI8-R" - echo "ansi-1251 CP1251" - echo "BIG5 BIG5" - echo "Big5-HKSCS BIG5-HKSCS" - echo "gb2312 GB2312" - echo "GBK GBK" - echo "GB18030 GB18030" - echo "cns11643 EUC-TW" - echo "5601 EUC-KR" - echo "ko_KR.johap92 JOHAB" - echo "eucJP EUC-JP" - echo "PCK SHIFT_JIS" - echo "TIS620.2533 TIS-620" - #echo "sun_eu_greek ?" # what is this? - echo "UTF-8 UTF-8" - ;; - freebsd*) - # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore - # localcharset.c falls back to using the full locale name - # from the environment variables. - echo "C ASCII" - echo "US-ASCII ASCII" - for l in la_LN lt_LN; do - echo "$l.ASCII ASCII" - done - for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \ - fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \ - lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do - echo "$l.ISO_8859-1 ISO-8859-1" - echo "$l.DIS_8859-15 ISO-8859-15" - done - for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do - echo "$l.ISO_8859-2 ISO-8859-2" - done - for l in la_LN lt_LT; do - echo "$l.ISO_8859-4 ISO-8859-4" - done - for l in ru_RU ru_SU; do - echo "$l.KOI8-R KOI8-R" - echo "$l.ISO_8859-5 ISO-8859-5" - echo "$l.CP866 CP866" - done - echo "uk_UA.KOI8-U KOI8-U" - echo "zh_TW.BIG5 BIG5" - echo "zh_TW.Big5 BIG5" - echo "zh_CN.EUC GB2312" - echo "ja_JP.EUC EUC-JP" - echo "ja_JP.SJIS SHIFT_JIS" - echo "ja_JP.Shift_JIS SHIFT_JIS" - echo "ko_KR.EUC EUC-KR" - ;; - netbsd*) - echo "646 ASCII" - echo "ISO8859-1 ISO-8859-1" - echo "ISO8859-2 ISO-8859-2" - echo "ISO8859-4 ISO-8859-4" - echo "ISO8859-5 ISO-8859-5" - echo "ISO8859-7 ISO-8859-7" - echo "ISO8859-13 ISO-8859-13" - echo "ISO8859-15 ISO-8859-15" - echo "eucCN GB2312" - echo "eucJP EUC-JP" - echo "eucKR EUC-KR" - echo "eucTW EUC-TW" - echo "BIG5 BIG5" - echo "SJIS SHIFT_JIS" - ;; - openbsd*) - echo "646 ASCII" - echo "ISO8859-1 ISO-8859-1" - echo "ISO8859-2 ISO-8859-2" - echo "ISO8859-4 ISO-8859-4" - echo "ISO8859-5 ISO-8859-5" - echo "ISO8859-7 ISO-8859-7" - echo "ISO8859-13 ISO-8859-13" - echo "ISO8859-15 ISO-8859-15" - ;; - darwin[56]*) - # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore - # localcharset.c falls back to using the full locale name - # from the environment variables. - echo "C ASCII" - for l in en_AU en_CA en_GB en_US la_LN; do - echo "$l.US-ASCII ASCII" - done - for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \ - fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \ - nl_NL no_NO pt_PT sv_SE; do - echo "$l ISO-8859-1" - echo "$l.ISO8859-1 ISO-8859-1" - echo "$l.ISO8859-15 ISO-8859-15" - done - for l in la_LN; do - echo "$l.ISO8859-1 ISO-8859-1" - echo "$l.ISO8859-15 ISO-8859-15" - done - for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do - echo "$l.ISO8859-2 ISO-8859-2" - done - for l in la_LN lt_LT; do - echo "$l.ISO8859-4 ISO-8859-4" - done - for l in ru_RU; do - echo "$l.KOI8-R KOI8-R" - echo "$l.ISO8859-5 ISO-8859-5" - echo "$l.CP866 CP866" - done - for l in bg_BG; do - echo "$l.CP1251 CP1251" - done - echo "uk_UA.KOI8-U KOI8-U" - echo "zh_TW.BIG5 BIG5" - echo "zh_TW.Big5 BIG5" - echo "zh_CN.EUC GB2312" - echo "ja_JP.EUC EUC-JP" - echo "ja_JP.SJIS SHIFT_JIS" - echo "ko_KR.EUC EUC-KR" - ;; - darwin*) - # Darwin 7.5 has nl_langinfo(CODESET), but sometimes its value is - # useless: - # - It returns the empty string when LANG is set to a locale of the - # form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8 - # LC_CTYPE file. - # - The environment variables LANG, LC_CTYPE, LC_ALL are not set by - # the system; nl_langinfo(CODESET) returns "US-ASCII" in this case. - # - The documentation says: - # "... all code that calls BSD system routines should ensure - # that the const *char parameters of these routines are in UTF-8 - # encoding. All BSD system functions expect their string - # parameters to be in UTF-8 encoding and nothing else." - # It also says - # "An additional caveat is that string parameters for files, - # paths, and other file-system entities must be in canonical - # UTF-8. In a canonical UTF-8 Unicode string, all decomposable - # characters are decomposed ..." - # but this is not true: You can pass non-decomposed UTF-8 strings - # to file system functions, and it is the OS which will convert - # them to decomposed UTF-8 before accessing the file system. - # - The Apple Terminal application displays UTF-8 by default. - # - However, other applications are free to use different encodings: - # - xterm uses ISO-8859-1 by default. - # - TextEdit uses MacRoman by default. - # We prefer UTF-8 over decomposed UTF-8-MAC because one should - # minimize the use of decomposed Unicode. Unfortunately, through the - # Darwin file system, decomposed UTF-8 strings are leaked into user - # space nevertheless. - # Then there are also the locales with encodings other than US-ASCII - # and UTF-8. These locales can be occasionally useful to users (e.g. - # when grepping through ISO-8859-1 encoded text files), when all their - # file names are in US-ASCII. - echo "ISO8859-1 ISO-8859-1" - echo "ISO8859-2 ISO-8859-2" - echo "ISO8859-4 ISO-8859-4" - echo "ISO8859-5 ISO-8859-5" - echo "ISO8859-7 ISO-8859-7" - echo "ISO8859-9 ISO-8859-9" - echo "ISO8859-13 ISO-8859-13" - echo "ISO8859-15 ISO-8859-15" - echo "KOI8-R KOI8-R" - echo "KOI8-U KOI8-U" - echo "CP866 CP866" - echo "CP949 CP949" - echo "CP1131 CP1131" - echo "CP1251 CP1251" - echo "eucCN GB2312" - echo "GB2312 GB2312" - echo "eucJP EUC-JP" - echo "eucKR EUC-KR" - echo "Big5 BIG5" - echo "Big5HKSCS BIG5-HKSCS" - echo "GBK GBK" - echo "GB18030 GB18030" - echo "SJIS SHIFT_JIS" - echo "ARMSCII-8 ARMSCII-8" - echo "PT154 PT154" - #echo "ISCII-DEV ?" - echo "* UTF-8" - ;; - beos* | haiku*) - # BeOS and Haiku have a single locale, and it has UTF-8 encoding. - echo "* UTF-8" - ;; - msdosdjgpp*) - # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore - # localcharset.c falls back to using the full locale name - # from the environment variables. - echo "#" - echo "# The encodings given here may not all be correct." - echo "# If you find that the encoding given for your language and" - echo "# country is not the one your DOS machine actually uses, just" - echo "# correct it in this file, and send a mail to" - echo "# Juan Manuel Guerrero " - echo "# and Bruno Haible ." - echo "#" - echo "C ASCII" - # ISO-8859-1 languages - echo "ca CP850" - echo "ca_ES CP850" - echo "da CP865" # not CP850 ?? - echo "da_DK CP865" # not CP850 ?? - echo "de CP850" - echo "de_AT CP850" - echo "de_CH CP850" - echo "de_DE CP850" - echo "en CP850" - echo "en_AU CP850" # not CP437 ?? - echo "en_CA CP850" - echo "en_GB CP850" - echo "en_NZ CP437" - echo "en_US CP437" - echo "en_ZA CP850" # not CP437 ?? - echo "es CP850" - echo "es_AR CP850" - echo "es_BO CP850" - echo "es_CL CP850" - echo "es_CO CP850" - echo "es_CR CP850" - echo "es_CU CP850" - echo "es_DO CP850" - echo "es_EC CP850" - echo "es_ES CP850" - echo "es_GT CP850" - echo "es_HN CP850" - echo "es_MX CP850" - echo "es_NI CP850" - echo "es_PA CP850" - echo "es_PY CP850" - echo "es_PE CP850" - echo "es_SV CP850" - echo "es_UY CP850" - echo "es_VE CP850" - echo "et CP850" - echo "et_EE CP850" - echo "eu CP850" - echo "eu_ES CP850" - echo "fi CP850" - echo "fi_FI CP850" - echo "fr CP850" - echo "fr_BE CP850" - echo "fr_CA CP850" - echo "fr_CH CP850" - echo "fr_FR CP850" - echo "ga CP850" - echo "ga_IE CP850" - echo "gd CP850" - echo "gd_GB CP850" - echo "gl CP850" - echo "gl_ES CP850" - echo "id CP850" # not CP437 ?? - echo "id_ID CP850" # not CP437 ?? - echo "is CP861" # not CP850 ?? - echo "is_IS CP861" # not CP850 ?? - echo "it CP850" - echo "it_CH CP850" - echo "it_IT CP850" - echo "lt CP775" - echo "lt_LT CP775" - echo "lv CP775" - echo "lv_LV CP775" - echo "nb CP865" # not CP850 ?? - echo "nb_NO CP865" # not CP850 ?? - echo "nl CP850" - echo "nl_BE CP850" - echo "nl_NL CP850" - echo "nn CP865" # not CP850 ?? - echo "nn_NO CP865" # not CP850 ?? - echo "no CP865" # not CP850 ?? - echo "no_NO CP865" # not CP850 ?? - echo "pt CP850" - echo "pt_BR CP850" - echo "pt_PT CP850" - echo "sv CP850" - echo "sv_SE CP850" - # ISO-8859-2 languages - echo "cs CP852" - echo "cs_CZ CP852" - echo "hr CP852" - echo "hr_HR CP852" - echo "hu CP852" - echo "hu_HU CP852" - echo "pl CP852" - echo "pl_PL CP852" - echo "ro CP852" - echo "ro_RO CP852" - echo "sk CP852" - echo "sk_SK CP852" - echo "sl CP852" - echo "sl_SI CP852" - echo "sq CP852" - echo "sq_AL CP852" - echo "sr CP852" # CP852 or CP866 or CP855 ?? - echo "sr_CS CP852" # CP852 or CP866 or CP855 ?? - echo "sr_YU CP852" # CP852 or CP866 or CP855 ?? - # ISO-8859-3 languages - echo "mt CP850" - echo "mt_MT CP850" - # ISO-8859-5 languages - echo "be CP866" - echo "be_BE CP866" - echo "bg CP866" # not CP855 ?? - echo "bg_BG CP866" # not CP855 ?? - echo "mk CP866" # not CP855 ?? - echo "mk_MK CP866" # not CP855 ?? - echo "ru CP866" - echo "ru_RU CP866" - echo "uk CP1125" - echo "uk_UA CP1125" - # ISO-8859-6 languages - echo "ar CP864" - echo "ar_AE CP864" - echo "ar_DZ CP864" - echo "ar_EG CP864" - echo "ar_IQ CP864" - echo "ar_IR CP864" - echo "ar_JO CP864" - echo "ar_KW CP864" - echo "ar_MA CP864" - echo "ar_OM CP864" - echo "ar_QA CP864" - echo "ar_SA CP864" - echo "ar_SY CP864" - # ISO-8859-7 languages - echo "el CP869" - echo "el_GR CP869" - # ISO-8859-8 languages - echo "he CP862" - echo "he_IL CP862" - # ISO-8859-9 languages - echo "tr CP857" - echo "tr_TR CP857" - # Japanese - echo "ja CP932" - echo "ja_JP CP932" - # Chinese - echo "zh_CN GBK" - echo "zh_TW CP950" # not CP938 ?? - # Korean - echo "kr CP949" # not CP934 ?? - echo "kr_KR CP949" # not CP934 ?? - # Thai - echo "th CP874" - echo "th_TH CP874" - # Other - echo "eo CP850" - echo "eo_EO CP850" - ;; -esac diff --git a/gnu/creat-safer.c b/gnu/creat-safer.c new file mode 100644 index 0000000000000000000000000000000000000000..243831d113065c1388446bf1a702d264f26d679c --- /dev/null +++ b/gnu/creat-safer.c @@ -0,0 +1,31 @@ +/* Invoke creat, but avoid some glitches. + + Copyright (C) 2005-2006, 2009-2019 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 + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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 . */ + +/* Written by Jim Meyering. */ + +#include + +#include "fcntl-safer.h" + +#include +#include "unistd-safer.h" + +int +creat_safer (char const *file, mode_t mode) +{ + return fd_safer (creat (file, mode)); +} diff --git a/gnu/dirent--.h b/gnu/dirent--.h index a033f555c1e25d54a2c0c246c88d6eec69628874..167d210bfdc5e3d1425af587311c3e1e64e0c968 100644 --- a/gnu/dirent--.h +++ b/gnu/dirent--.h @@ -1,6 +1,6 @@ /* Like dirent.h, but redefine some names to avoid glitches. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/dirent-private.h b/gnu/dirent-private.h index c9bf3b29d3382b50d4dce4d15e19aada7bd84260..1eb1b357ce1c6fabbb36d0b079acd5ba0e3cc2b1 100644 --- a/gnu/dirent-private.h +++ b/gnu/dirent-private.h @@ -1,5 +1,5 @@ /* Private details of the DIR type. - Copyright (C) 2011-2017 Free Software Foundation, Inc. + Copyright (C) 2011-2019 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 diff --git a/gnu/dirent-safer.h b/gnu/dirent-safer.h index 35ff95e2395d9c78aa7bb575d7413ed7303eb56c..4d8e5ee922738baed78462e2acc74a5fa7ba1e4d 100644 --- a/gnu/dirent-safer.h +++ b/gnu/dirent-safer.h @@ -1,6 +1,6 @@ /* Invoke dirent-like functions, but avoid some glitches. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/dirent.in.h b/gnu/dirent.in.h index 5b235731e0437105d948b41ae0c67b6eb26601bd..a3c8eb341e97e864cc7785f950e42826460b5a21 100644 --- a/gnu/dirent.in.h +++ b/gnu/dirent.in.h @@ -1,5 +1,5 @@ /* A GNU-like . - Copyright (C) 2006-2017 Free Software Foundation, Inc. + Copyright (C) 2006-2019 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 diff --git a/gnu/dirfd.c b/gnu/dirfd.c index 7e38fabdac2a365b6f58ccf8463b0ce350eea384..bc858fd09dd2fd03596f48ec6b22a2ee46cb3d64 100644 --- a/gnu/dirfd.c +++ b/gnu/dirfd.c @@ -1,6 +1,6 @@ /* dirfd.c -- return the file descriptor associated with an open DIR* - Copyright (C) 2001, 2006, 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2001, 2006, 2008-2019 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 diff --git a/gnu/dirname-lgpl.c b/gnu/dirname-lgpl.c index 6791185dc73a9390a6b12d6e037fefe6f8f45b20..7cf89d8cf80e2d21c81c954a22e6de6cdf916b3d 100644 --- a/gnu/dirname-lgpl.c +++ b/gnu/dirname-lgpl.c @@ -1,6 +1,6 @@ /* dirname.c -- return all but the last element in a file name - Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2017 Free Software + Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/dirname.c b/gnu/dirname.c index 4b475ce916ff99d2cf9ba95a1e86cfe6e6e410fa..1e042a5cdc9643c7568219390b1b55f9ca4225e3 100644 --- a/gnu/dirname.c +++ b/gnu/dirname.c @@ -1,6 +1,6 @@ /* dirname.c -- return all but the last element in a file name - Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2017 Free Software + Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/dirname.h b/gnu/dirname.h index 05cab41f0b88c1134939e7f2a67bc13312bd72ec..579165947f742be281df8dba3bc658b585a9ab07 100644 --- a/gnu/dirname.h +++ b/gnu/dirname.h @@ -1,6 +1,6 @@ /* Take file names apart into directory and base names. - Copyright (C) 1998, 2001, 2003-2006, 2009-2017 Free Software Foundation, + Copyright (C) 1998, 2001, 2003-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -36,7 +36,7 @@ extern "C" { #endif # if GNULIB_DIRNAME -char *base_name (char const *file); +char *base_name (char const *file) _GL_ATTRIBUTE_MALLOC; char *dir_name (char const *file); # endif diff --git a/gnu/dosname.h b/gnu/dosname.h index 255d57e4d6be076a39d1e295c707a3305553e1c1..c0ab6848a58aa2e0352272872d4bc009886455f6 100644 --- a/gnu/dosname.h +++ b/gnu/dosname.h @@ -1,6 +1,6 @@ /* File names on MS-DOS/Windows systems. - Copyright (C) 2000-2001, 2004-2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2000-2001, 2004-2006, 2009-2019 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 @@ -20,9 +20,8 @@ #ifndef _DOSNAME_H #define _DOSNAME_H -#if (defined _WIN32 || defined __WIN32__ || \ - defined __MSDOS__ || defined __CYGWIN__ || \ - defined __EMX__ || defined __DJGPP__) +#if (defined _WIN32 || defined __CYGWIN__ \ + || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__) /* This internal macro assumes ASCII, but all hosts that support drive letters use ASCII. */ # define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a' \ diff --git a/gnu/dup-safer-flag.c b/gnu/dup-safer-flag.c index 5e286271bcd5e8181e9a359560245d18c9aa8f3f..485f7411bdb07198d363e4b96f47370a43960638 100644 --- a/gnu/dup-safer-flag.c +++ b/gnu/dup-safer-flag.c @@ -1,7 +1,7 @@ /* Duplicate a file descriptor result, avoiding clobbering STD{IN,OUT,ERR}_FILENO, with specific flags. - Copyright (C) 2001, 2004-2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2001, 2004-2006, 2009-2019 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 diff --git a/gnu/dup-safer.c b/gnu/dup-safer.c index a063e973a9e29b8886660a9c9d085eb56ef42202..c0c5f2a914b83f7e703054a74a618bbf4d24509a 100644 --- a/gnu/dup-safer.c +++ b/gnu/dup-safer.c @@ -1,6 +1,6 @@ /* Invoke dup, but avoid some glitches. - Copyright (C) 2001, 2004-2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2001, 2004-2006, 2009-2019 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 diff --git a/gnu/dup.c b/gnu/dup.c index 098e25f7e920ea265e729706b64d1200d7b799c3..d37f920d858660c8fd074d1299c331b88c85ddb4 100644 --- a/gnu/dup.c +++ b/gnu/dup.c @@ -1,6 +1,6 @@ /* Duplicate an open file descriptor. - Copyright (C) 2011-2017 Free Software Foundation, Inc. + Copyright (C) 2011-2019 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 diff --git a/gnu/dup2.c b/gnu/dup2.c index 85c1a44401a10add957c0ed1f32de4159a0b4081..d3aafa458b5a793f6a7e9008caea3835d495cb18 100644 --- a/gnu/dup2.c +++ b/gnu/dup2.c @@ -1,6 +1,6 @@ /* Duplicate an open file descriptor to a specified file descriptor. - Copyright (C) 1999, 2004-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1999, 2004-2007, 2009-2019 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 @@ -29,7 +29,7 @@ # undef dup2 -# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# if defined _WIN32 && ! defined __CYGWIN__ /* Get declarations of the native Windows API functions. */ # define WIN32_LEAN_AND_MEAN diff --git a/gnu/errno.in.h b/gnu/errno.in.h index aaf5fecd73bc08cade57566d1e6dcc127ad4d2b9..3bd27f1cc9fb7e555aa3b048b0e3bc3aebd1bf40 100644 --- a/gnu/errno.in.h +++ b/gnu/errno.in.h @@ -1,6 +1,6 @@ /* A POSIX-like . - Copyright (C) 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2008-2019 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 @@ -30,7 +30,7 @@ /* On native Windows platforms, many macros are not defined. */ -# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# if defined _WIN32 && ! defined __CYGWIN__ /* These are the same values as defined by MSVC 10, for interoperability. */ @@ -248,7 +248,7 @@ interoperability. */ # define EOWNERDEAD 58 # define ENOTRECOVERABLE 59 -# elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# elif defined _WIN32 && ! defined __CYGWIN__ /* We have a conflict here: pthreads-win32 defines these values differently than MSVC 10. It's hairy to decide which one to use. */ # if defined __MINGW32__ && !defined USE_WINDOWS_THREADS diff --git a/gnu/error.c b/gnu/error.c index ce81a1eedd689de61d347094dbe5873b39dceb25..7e532f0e486c3dcb7512ef287ece0cf02e08d1b9 100644 --- a/gnu/error.c +++ b/gnu/error.c @@ -1,5 +1,5 @@ /* Error handler for noninteractive utilities - Copyright (C) 1990-1998, 2000-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1990-1998, 2000-2007, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify @@ -93,7 +93,7 @@ extern void __error_at_line (int status, int errnum, const char *file_name, # include # include -# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# if defined _WIN32 && ! defined __CYGWIN__ /* Get declarations of the native Windows API functions. */ # define WIN32_LEAN_AND_MEAN # include @@ -131,7 +131,7 @@ int strerror_r (int errnum, char *buf, size_t buflen); static int is_open (int fd) { -# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# if defined _WIN32 && ! defined __CYGWIN__ /* On native Windows: The initial state of unassigned standard file descriptors is that they are open but point to an INVALID_HANDLE_VALUE. There is no fcntl, and the gnulib replacement fcntl does not support diff --git a/gnu/error.h b/gnu/error.h index dc004ef61dfc52c635c24b3133de271ea343e055..3759f8ad44e9a01f467093ebb8b1990f4f7b3d18 100644 --- a/gnu/error.h +++ b/gnu/error.h @@ -1,5 +1,5 @@ /* Declaration for error-reporting function - Copyright (C) 1995-1997, 2003, 2006, 2008-2017 Free Software Foundation, + Copyright (C) 1995-1997, 2003, 2006, 2008-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/gnu/euidaccess.c b/gnu/euidaccess.c index 298c4459477a81fa01c0ff80f7073eaa4bd634a5..fece4cfc5e09dce5ddf5dcb2e8f6d0da5bcde3ea 100644 --- a/gnu/euidaccess.c +++ b/gnu/euidaccess.c @@ -1,6 +1,6 @@ /* euidaccess -- check if effective user id can access file - Copyright (C) 1990-1991, 1995, 1998, 2000, 2003-2006, 2008-2017 Free + Copyright (C) 1990-1991, 1995, 1998, 2000, 2003-2006, 2008-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -29,8 +29,11 @@ #include #include #include - -#include "root-uid.h" +#if defined _WIN32 && ! defined __CYGWIN__ +# include +#else +# include "root-uid.h" +#endif #if HAVE_LIBGEN_H # include @@ -84,7 +87,9 @@ euidaccess (const char *file, int mode) return accessx (file, mode, ACC_SELF); #elif HAVE_EACCESS /* FreeBSD */ return eaccess (file, mode); -#else /* Mac OS X, NetBSD, OpenBSD, HP-UX, Solaris, Cygwin, mingw, BeOS */ +#elif defined _WIN32 && ! defined __CYGWIN__ /* mingw */ + return _access (file, mode); +#else /* Mac OS X, NetBSD, OpenBSD, HP-UX, Solaris, Cygwin, BeOS */ uid_t uid = getuid (); gid_t gid = getgid (); diff --git a/gnu/exclude.c b/gnu/exclude.c index 50ecb3603c349698d1acb29c138eef86e1ee2b74..2140386526eb0f5184035831fc9693ef41d789c1 100644 --- a/gnu/exclude.c +++ b/gnu/exclude.c @@ -1,6 +1,6 @@ /* exclude.c -- exclude file names - Copyright (C) 1992-1994, 1997, 1999-2007, 2009-2017 Free Software + Copyright (C) 1992-1994, 1997, 1999-2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -146,20 +146,20 @@ fnmatch_pattern_has_wildcards (const char *str, int options) { switch (*str++) { - case '.': - case '{': - case '}': - case '(': - case ')': - if (options & EXCLUDE_REGEX) - return true; - break; + case '.': + case '{': + case '}': + case '(': + case ')': + if (options & EXCLUDE_REGEX) + return true; + break; case '\\': - if (options & EXCLUDE_REGEX) - continue; - else - str += ! (options & FNM_NOESCAPE) && *str; + if (options & EXCLUDE_REGEX) + continue; + else + str += ! (options & FNM_NOESCAPE) && *str; break; case '+': case '@': case '!': @@ -287,10 +287,10 @@ free_exclude_segment (struct exclude_segment *seg) { case exclude_pattern: for (i = 0; i < seg->v.pat.exclude_count; i++) - { - if (seg->v.pat.exclude[i].options & EXCLUDE_REGEX) - regfree (&seg->v.pat.exclude[i].v.re); - } + { + if (seg->v.pat.exclude[i].options & EXCLUDE_REGEX) + regfree (&seg->v.pat.exclude[i].v.re); + } free (seg->v.pat.exclude); break; @@ -387,7 +387,7 @@ exclude_fnmatch (char const *pattern, char const *f, int options) if (! (options & EXCLUDE_ANCHORED)) for (p = f; *p && ! matched; p++) if (*p == '/' && p[1] != '/') - matched = ((*matcher) (pattern, p + 1, options) == 0); + matched = ((*matcher) (pattern, p + 1, options) == 0); return matched; } @@ -525,9 +525,9 @@ add_exclude (struct exclude *ex, char const *pattern, int options) && fnmatch_pattern_has_wildcards (pattern, options)) { if (! (ex->head && ex->head->type == exclude_pattern - && ((ex->head->options & EXCLUDE_INCLUDE) - == (options & EXCLUDE_INCLUDE)))) - new_exclude_segment (ex, exclude_pattern, options); + && ((ex->head->options & EXCLUDE_INCLUDE) + == (options & EXCLUDE_INCLUDE)))) + new_exclude_segment (ex, exclude_pattern, options); seg = ex->head; @@ -539,48 +539,48 @@ add_exclude (struct exclude *ex, char const *pattern, int options) patopts->options = options; if (options & EXCLUDE_REGEX) - { - int rc; - int cflags = REG_NOSUB|REG_EXTENDED| - ((options & FNM_CASEFOLD) ? REG_ICASE : 0); - - if (options & FNM_LEADING_DIR) - { - char *tmp; - size_t len = strlen (pattern); - - while (len > 0 && ISSLASH (pattern[len-1])) - --len; - - if (len == 0) - rc = 1; - else - { - tmp = xmalloc (len + 7); - memcpy (tmp, pattern, len); - strcpy (tmp + len, "(/.*)?"); - rc = regcomp (&patopts->v.re, tmp, cflags); - free (tmp); - } - } - else - rc = regcomp (&patopts->v.re, pattern, cflags); - - if (rc) - { - pat->exclude_count--; - return; - } - } + { + int rc; + int cflags = REG_NOSUB|REG_EXTENDED| + ((options & FNM_CASEFOLD) ? REG_ICASE : 0); + + if (options & FNM_LEADING_DIR) + { + char *tmp; + size_t len = strlen (pattern); + + while (len > 0 && ISSLASH (pattern[len-1])) + --len; + + if (len == 0) + rc = 1; + else + { + tmp = xmalloc (len + 7); + memcpy (tmp, pattern, len); + strcpy (tmp + len, "(/.*)?"); + rc = regcomp (&patopts->v.re, tmp, cflags); + free (tmp); + } + } + else + rc = regcomp (&patopts->v.re, pattern, cflags); + + if (rc) + { + pat->exclude_count--; + return; + } + } else - { - if (options & EXCLUDE_ALLOC) - { - pattern = xstrdup (pattern); - exclude_add_pattern_buffer (ex, (char*) pattern); - } - patopts->v.pattern = pattern; - } + { + if (options & EXCLUDE_ALLOC) + { + pattern = xstrdup (pattern); + exclude_add_pattern_buffer (ex, (char*) pattern); + } + patopts->v.pattern = pattern; + } } else { @@ -609,9 +609,9 @@ add_exclude (struct exclude *ex, char const *pattern, int options) int add_exclude_fp (void (*add_func) (struct exclude *, char const *, int, void *), - struct exclude *ex, FILE *fp, int options, - char line_end, - void *data) + struct exclude *ex, FILE *fp, int options, + char line_end, + void *data) { char *buf = NULL; char *p; @@ -674,8 +674,8 @@ call_addfn (struct exclude *ex, char const *pattern, int options, void *data) int add_exclude_file (void (*add_func) (struct exclude *, char const *, int), - struct exclude *ex, char const *file_name, int options, - char line_end) + struct exclude *ex, char const *file_name, int options, + char line_end) { bool use_stdin = file_name[0] == '-' && !file_name[1]; FILE *in; diff --git a/gnu/exclude.h b/gnu/exclude.h index 62cab7107bd90cdc64169165fab8cc9394d4f578..4ab00e3b1f53a47af73c7842b19c4116a9ced598 100644 --- a/gnu/exclude.h +++ b/gnu/exclude.h @@ -1,6 +1,6 @@ /* exclude.h -- declarations for excluding file names - Copyright (C) 1992-1994, 1997, 1999, 2001-2003, 2005-2006, 2009-2017 Free + Copyright (C) 1992-1994, 1997, 1999, 2001-2003, 2005-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -48,13 +48,13 @@ struct exclude; bool fnmatch_pattern_has_wildcards (const char *, int) _GL_ATTRIBUTE_PURE; -struct exclude *new_exclude (void); +struct exclude *new_exclude (void) _GL_ATTRIBUTE_MALLOC; void free_exclude (struct exclude *); void add_exclude (struct exclude *, char const *, int); int add_exclude_file (void (*) (struct exclude *, char const *, int), struct exclude *, char const *, int, char); int add_exclude_fp (void (*) (struct exclude *, char const *, int, void *), - struct exclude *, FILE *, int, char, void *); + struct exclude *, FILE *, int, char, void *); bool excluded_file_name (struct exclude const *, char const *); void exclude_add_pattern_buffer (struct exclude *ex, char *buf); bool exclude_fnmatch (char const *, char const *, int); diff --git a/gnu/exitfail.c b/gnu/exitfail.c index b2d601211b154d507207b650b967601eaed72462..69b351372e5b4013d912694da24b62c8bc4c4b11 100644 --- a/gnu/exitfail.c +++ b/gnu/exitfail.c @@ -1,6 +1,6 @@ /* Failure exit status - Copyright (C) 2002-2003, 2005-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2007, 2009-2019 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 diff --git a/gnu/exitfail.h b/gnu/exitfail.h index 819919a76b7bd6d863855b0ee0334b5e901f0dba..480ad1a1663d303243be2483973d62d8c73bb034 100644 --- a/gnu/exitfail.h +++ b/gnu/exitfail.h @@ -1,6 +1,6 @@ /* Failure exit status - Copyright (C) 2002, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2002, 2009-2019 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 diff --git a/gnu/faccessat.c b/gnu/faccessat.c index fa9235820dc310adcff25674a5043e557be983b3..6c63e61d83f48c99f6aeeb58e13575dfc50f7759 100644 --- a/gnu/faccessat.c +++ b/gnu/faccessat.c @@ -1,5 +1,5 @@ /* Check the access rights of a file relative to an open directory. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/fchdir.c b/gnu/fchdir.c index 1ce5d3f9d1f70336bfd527773ddeeaa9200fe04c..38ab802e0645e7289e2465ff2ab07dd7e03a9284 100644 --- a/gnu/fchdir.c +++ b/gnu/fchdir.c @@ -1,5 +1,5 @@ /* fchdir replacement. - Copyright (C) 2006-2017 Free Software Foundation, Inc. + Copyright (C) 2006-2019 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 diff --git a/gnu/fchmodat.c b/gnu/fchmodat.c index 639831e794aeae9d58a298180195466655eba2a1..088d3c023b93241023bfd3596029e65075e753c4 100644 --- a/gnu/fchmodat.c +++ b/gnu/fchmodat.c @@ -1,5 +1,5 @@ /* Change the protections of file relative to an open directory. - Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2019 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 diff --git a/gnu/fchownat.c b/gnu/fchownat.c index ff58216c63ca7733d7659463c4aa79794691641c..538d86d690705f68f88ae58b9756dff868e60c5b 100644 --- a/gnu/fchownat.c +++ b/gnu/fchownat.c @@ -4,7 +4,7 @@ when the buggy fchownat-with-AT_SYMLINK_NOFOLLOW operates on a symlink, it mistakenly affects the symlink referent, rather than the symlink itself. - Copyright (C) 2006-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2006-2007, 2009-2019 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 diff --git a/gnu/fcntl--.h b/gnu/fcntl--.h new file mode 100644 index 0000000000000000000000000000000000000000..9f22e68367f5b5e6346993a451b230d44ba9c4d8 --- /dev/null +++ b/gnu/fcntl--.h @@ -0,0 +1,32 @@ +/* Like fcntl.h, but redefine some names to avoid glitches. + + Copyright (C) 2005, 2009-2019 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 + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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 . */ + +/* Written by Paul Eggert. */ + +#include +#include "fcntl-safer.h" + +#undef open +#define open open_safer + +#undef creat +#define creat creat_safer + +#if GNULIB_OPENAT_SAFER +# undef openat +# define openat openat_safer +#endif diff --git a/gnu/fcntl-safer.h b/gnu/fcntl-safer.h new file mode 100644 index 0000000000000000000000000000000000000000..4a7734ee783ccbb52c9b5dee403bd3cf75303b6b --- /dev/null +++ b/gnu/fcntl-safer.h @@ -0,0 +1,27 @@ +/* Invoke fcntl-like functions, but avoid some glitches. + + Copyright (C) 2005, 2009-2019 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 + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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 . */ + +/* Written by Paul Eggert. */ + +#include + +int open_safer (char const *, int, ...); +int creat_safer (char const *, mode_t); + +#if GNULIB_OPENAT_SAFER +int openat_safer (int, char const *, int, ...); +#endif diff --git a/gnu/fcntl.c b/gnu/fcntl.c index 91efd12c2ba2b518049b1718f1f97362f37b85e9..f602fad6285108a7874384babf52b609e88a9079 100644 --- a/gnu/fcntl.c +++ b/gnu/fcntl.c @@ -1,6 +1,6 @@ /* Provide file descriptor control. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 @@ -27,12 +27,12 @@ #include #include -#if !HAVE_FCNTL -# define rpl_fcntl fcntl +#ifdef __KLIBC__ +# define INCL_DOS +# include #endif -#undef fcntl -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ /* Get declarations of the native Windows API functions. */ # define WIN32_LEAN_AND_MEAN # include @@ -166,93 +166,18 @@ dupfd (int oldfd, int newfd, int flags) } #endif /* W32 */ +/* Forward declarations, because we '#undef fcntl' in the middle of this + compilation unit. */ +/* Our implementation of fcntl (fd, F_DUPFD, target). */ +static int rpl_fcntl_DUPFD (int fd, int target); +/* Our implementation of fcntl (fd, F_DUPFD_CLOEXEC, target). */ +static int rpl_fcntl_DUPFD_CLOEXEC (int fd, int target); #ifdef __KLIBC__ - -# define INCL_DOS -# include - -static int -klibc_fcntl (int fd, int action, /* arg */...) -{ - va_list arg_ptr; - int arg; - struct stat sbuf; - int result = -1; - - va_start (arg_ptr, action); - arg = va_arg (arg_ptr, int); - result = fcntl (fd, action, arg); - /* EPERM for F_DUPFD, ENOTSUP for others */ - if (result == -1 && (errno == EPERM || errno == ENOTSUP) - && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode)) - { - ULONG ulMode; - - switch (action) - { - case F_DUPFD: - /* Find available fd */ - while (fcntl (arg, F_GETFL) != -1 || errno != EBADF) - arg++; - - result = dup2 (fd, arg); - break; - - /* Using underlying APIs is right ? */ - case F_GETFD: - if (DosQueryFHState (fd, &ulMode)) - break; - - result = (ulMode & OPEN_FLAGS_NOINHERIT) ? FD_CLOEXEC : 0; - break; - - case F_SETFD: - if (arg & ~FD_CLOEXEC) - break; - - if (DosQueryFHState (fd, &ulMode)) - break; - - if (arg & FD_CLOEXEC) - ulMode |= OPEN_FLAGS_NOINHERIT; - else - ulMode &= ~OPEN_FLAGS_NOINHERIT; - - /* Filter supported flags. */ - ulMode &= (OPEN_FLAGS_WRITE_THROUGH | OPEN_FLAGS_FAIL_ON_ERROR - | OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_NOINHERIT); - - if (DosSetFHState (fd, ulMode)) - break; - - result = 0; - break; - - case F_GETFL: - result = 0; - break; - - case F_SETFL: - if (arg != 0) - break; - - result = 0; - break; - - default : - errno = EINVAL; - break; - } - } - - va_end (arg_ptr); - - return result; -} - -# define fcntl klibc_fcntl +/* Adds support for fcntl on directories. */ +static int klibc_fcntl (int fd, int action, /* arg */...); #endif + /* Perform the specified ACTION on the file descriptor FD, possibly using the argument ARG further described below. This replacement handles the following actions, and forwards all others on to the @@ -273,110 +198,35 @@ klibc_fcntl (int fd, int action, /* arg */...) return -1 and set errno. */ int -rpl_fcntl (int fd, int action, /* arg */...) +fcntl (int fd, int action, /* arg */...) +#undef fcntl +#ifdef __KLIBC__ +# define fcntl klibc_fcntl +#endif { va_list arg; int result = -1; va_start (arg, action); switch (action) { - -#if !HAVE_FCNTL case F_DUPFD: { int target = va_arg (arg, int); - result = dupfd (fd, target, 0); + result = rpl_fcntl_DUPFD (fd, target); break; } -#elif FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR - case F_DUPFD: - { - int target = va_arg (arg, int); - /* Detect invalid target; needed for cygwin 1.5.x. */ - if (target < 0 || getdtablesize () <= target) - errno = EINVAL; - else - { - /* Haiku alpha 2 loses fd flags on original. */ - int flags = fcntl (fd, F_GETFD); - if (flags < 0) - { - result = -1; - break; - } - result = fcntl (fd, action, target); - if (0 <= result && fcntl (fd, F_SETFD, flags) == -1) - { - int saved_errno = errno; - close (result); - result = -1; - errno = saved_errno; - } -# if REPLACE_FCHDIR - if (0 <= result) - result = _gl_register_dup (fd, result); -# endif - } - break; - } /* F_DUPFD */ -#endif /* FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR */ case F_DUPFD_CLOEXEC: { int target = va_arg (arg, int); - -#if !HAVE_FCNTL - result = dupfd (fd, target, O_CLOEXEC); - break; -#else /* HAVE_FCNTL */ - /* Try the system call first, if the headers claim it exists - (that is, if GNULIB_defined_F_DUPFD_CLOEXEC is 0), since we - may be running with a glibc that has the macro but with an - older kernel that does not support it. Cache the - information on whether the system call really works, but - avoid caching failure if the corresponding F_DUPFD fails - for any reason. 0 = unknown, 1 = yes, -1 = no. */ - static int have_dupfd_cloexec = GNULIB_defined_F_DUPFD_CLOEXEC ? -1 : 0; - if (0 <= have_dupfd_cloexec) - { - result = fcntl (fd, action, target); - if (0 <= result || errno != EINVAL) - { - have_dupfd_cloexec = 1; -# if REPLACE_FCHDIR - if (0 <= result) - result = _gl_register_dup (fd, result); -# endif - } - else - { - result = rpl_fcntl (fd, F_DUPFD, target); - if (result < 0) - break; - have_dupfd_cloexec = -1; - } - } - else - result = rpl_fcntl (fd, F_DUPFD, target); - if (0 <= result && have_dupfd_cloexec == -1) - { - int flags = fcntl (result, F_GETFD); - if (flags < 0 || fcntl (result, F_SETFD, flags | FD_CLOEXEC) == -1) - { - int saved_errno = errno; - close (result); - errno = saved_errno; - result = -1; - } - } + result = rpl_fcntl_DUPFD_CLOEXEC (fd, target); break; -#endif /* HAVE_FCNTL */ - } /* F_DUPFD_CLOEXEC */ + } #if !HAVE_FCNTL case F_GETFD: { -# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# if defined _WIN32 && ! defined __CYGWIN__ HANDLE handle = (HANDLE) _get_osfhandle (fd); DWORD flags; if (handle == INVALID_HANDLE_VALUE @@ -405,8 +255,183 @@ rpl_fcntl (int fd, int action, /* arg */...) default: { #if HAVE_FCNTL - void *p = va_arg (arg, void *); - result = fcntl (fd, action, p); + switch (action) + { + #ifdef F_BARRIERFSYNC /* macOS */ + case F_BARRIERFSYNC: + #endif + #ifdef F_CHKCLEAN /* macOS */ + case F_CHKCLEAN: + #endif + #ifdef F_CLOSEM /* NetBSD, HP-UX */ + case F_CLOSEM: + #endif + #ifdef F_FLUSH_DATA /* macOS */ + case F_FLUSH_DATA: + #endif + #ifdef F_FREEZE_FS /* macOS */ + case F_FREEZE_FS: + #endif + #ifdef F_FULLFSYNC /* macOS */ + case F_FULLFSYNC: + #endif + #ifdef F_GETCONFINED /* macOS */ + case F_GETCONFINED: + #endif + #ifdef F_GETDEFAULTPROTLEVEL /* macOS */ + case F_GETDEFAULTPROTLEVEL: + #endif + #ifdef F_GETFD /* POSIX */ + case F_GETFD: + #endif + #ifdef F_GETFL /* POSIX */ + case F_GETFL: + #endif + #ifdef F_GETLEASE /* Linux */ + case F_GETLEASE: + #endif + #ifdef F_GETNOSIGPIPE /* macOS */ + case F_GETNOSIGPIPE: + #endif + #ifdef F_GETOWN /* POSIX */ + case F_GETOWN: + #endif + #ifdef F_GETPIPE_SZ /* Linux */ + case F_GETPIPE_SZ: + #endif + #ifdef F_GETPROTECTIONCLASS /* macOS */ + case F_GETPROTECTIONCLASS: + #endif + #ifdef F_GETPROTECTIONLEVEL /* macOS */ + case F_GETPROTECTIONLEVEL: + #endif + #ifdef F_GET_SEALS /* Linux */ + case F_GET_SEALS: + #endif + #ifdef F_GETSIG /* Linux */ + case F_GETSIG: + #endif + #ifdef F_MAXFD /* NetBSD */ + case F_MAXFD: + #endif + #ifdef F_RECYCLE /* macOS */ + case F_RECYCLE: + #endif + #ifdef F_SETFIFOENH /* HP-UX */ + case F_SETFIFOENH: + #endif + #ifdef F_THAW_FS /* macOS */ + case F_THAW_FS: + #endif + /* These actions take no argument. */ + result = fcntl (fd, action); + break; + + #ifdef F_ADD_SEALS /* Linux */ + case F_ADD_SEALS: + #endif + #ifdef F_BADFD /* Solaris */ + case F_BADFD: + #endif + #ifdef F_CHECK_OPENEVT /* macOS */ + case F_CHECK_OPENEVT: + #endif + #ifdef F_DUP2FD /* FreeBSD, AIX, Solaris */ + case F_DUP2FD: + #endif + #ifdef F_DUP2FD_CLOEXEC /* FreeBSD, Solaris */ + case F_DUP2FD_CLOEXEC: + #endif + #ifdef F_DUP2FD_CLOFORK /* Solaris */ + case F_DUP2FD_CLOFORK: + #endif + #ifdef F_DUPFD /* POSIX */ + case F_DUPFD: + #endif + #ifdef F_DUPFD_CLOEXEC /* POSIX */ + case F_DUPFD_CLOEXEC: + #endif + #ifdef F_DUPFD_CLOFORK /* Solaris */ + case F_DUPFD_CLOFORK: + #endif + #ifdef F_GETXFL /* Solaris */ + case F_GETXFL: + #endif + #ifdef F_GLOBAL_NOCACHE /* macOS */ + case F_GLOBAL_NOCACHE: + #endif + #ifdef F_MAKECOMPRESSED /* macOS */ + case F_MAKECOMPRESSED: + #endif + #ifdef F_MOVEDATAEXTENTS /* macOS */ + case F_MOVEDATAEXTENTS: + #endif + #ifdef F_NOCACHE /* macOS */ + case F_NOCACHE: + #endif + #ifdef F_NODIRECT /* macOS */ + case F_NODIRECT: + #endif + #ifdef F_NOTIFY /* Linux */ + case F_NOTIFY: + #endif + #ifdef F_OPLKACK /* IRIX */ + case F_OPLKACK: + #endif + #ifdef F_OPLKREG /* IRIX */ + case F_OPLKREG: + #endif + #ifdef F_RDAHEAD /* macOS */ + case F_RDAHEAD: + #endif + #ifdef F_SETBACKINGSTORE /* macOS */ + case F_SETBACKINGSTORE: + #endif + #ifdef F_SETCONFINED /* macOS */ + case F_SETCONFINED: + #endif + #ifdef F_SETFD /* POSIX */ + case F_SETFD: + #endif + #ifdef F_SETFL /* POSIX */ + case F_SETFL: + #endif + #ifdef F_SETLEASE /* Linux */ + case F_SETLEASE: + #endif + #ifdef F_SETNOSIGPIPE /* macOS */ + case F_SETNOSIGPIPE: + #endif + #ifdef F_SETOWN /* POSIX */ + case F_SETOWN: + #endif + #ifdef F_SETPIPE_SZ /* Linux */ + case F_SETPIPE_SZ: + #endif + #ifdef F_SETPROTECTIONCLASS /* macOS */ + case F_SETPROTECTIONCLASS: + #endif + #ifdef F_SETSIG /* Linux */ + case F_SETSIG: + #endif + #ifdef F_SINGLE_WRITER /* macOS */ + case F_SINGLE_WRITER: + #endif + /* These actions take an 'int' argument. */ + { + int x = va_arg (arg, int); + result = fcntl (fd, action, x); + } + break; + + default: + /* Other actions take a pointer argument. */ + { + void *p = va_arg (arg, void *); + result = fcntl (fd, action, p); + } + break; + } #else errno = EINVAL; #endif @@ -416,3 +441,186 @@ rpl_fcntl (int fd, int action, /* arg */...) va_end (arg); return result; } + +static int +rpl_fcntl_DUPFD (int fd, int target) +{ + int result; +#if !HAVE_FCNTL + result = dupfd (fd, target, 0); +#elif FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR + /* Detect invalid target; needed for cygwin 1.5.x. */ + if (target < 0 || getdtablesize () <= target) + { + result = -1; + errno = EINVAL; + } + else + { + /* Haiku alpha 2 loses fd flags on original. */ + int flags = fcntl (fd, F_GETFD); + if (flags < 0) + result = -1; + else + { + result = fcntl (fd, F_DUPFD, target); + if (0 <= result && fcntl (fd, F_SETFD, flags) == -1) + { + int saved_errno = errno; + close (result); + result = -1; + errno = saved_errno; + } +# if REPLACE_FCHDIR + if (0 <= result) + result = _gl_register_dup (fd, result); +# endif + } + } +#else + result = fcntl (fd, F_DUPFD, target); +#endif + return result; +} + +static int +rpl_fcntl_DUPFD_CLOEXEC (int fd, int target) +{ + int result; +#if !HAVE_FCNTL + result = dupfd (fd, target, O_CLOEXEC); +#else /* HAVE_FCNTL */ +# if defined __HAIKU__ + /* On Haiku, the system fcntl (fd, F_DUPFD_CLOEXEC, target) sets + the FD_CLOEXEC flag on fd, not on target. Therefore avoid the + system fcntl in this case. */ +# define have_dupfd_cloexec -1 +# else + /* Try the system call first, if the headers claim it exists + (that is, if GNULIB_defined_F_DUPFD_CLOEXEC is 0), since we + may be running with a glibc that has the macro but with an + older kernel that does not support it. Cache the + information on whether the system call really works, but + avoid caching failure if the corresponding F_DUPFD fails + for any reason. 0 = unknown, 1 = yes, -1 = no. */ + static int have_dupfd_cloexec = GNULIB_defined_F_DUPFD_CLOEXEC ? -1 : 0; + if (0 <= have_dupfd_cloexec) + { + result = fcntl (fd, F_DUPFD_CLOEXEC, target); + if (0 <= result || errno != EINVAL) + { + have_dupfd_cloexec = 1; +# if REPLACE_FCHDIR + if (0 <= result) + result = _gl_register_dup (fd, result); +# endif + } + else + { + result = rpl_fcntl_DUPFD (fd, target); + if (result >= 0) + have_dupfd_cloexec = -1; + } + } + else +# endif + result = rpl_fcntl_DUPFD (fd, target); + if (0 <= result && have_dupfd_cloexec == -1) + { + int flags = fcntl (result, F_GETFD); + if (flags < 0 || fcntl (result, F_SETFD, flags | FD_CLOEXEC) == -1) + { + int saved_errno = errno; + close (result); + errno = saved_errno; + result = -1; + } + } +#endif /* HAVE_FCNTL */ + return result; +} + +#undef fcntl + +#ifdef __KLIBC__ + +static int +klibc_fcntl (int fd, int action, /* arg */...); +{ + va_list arg_ptr; + int arg; + struct stat sbuf; + int result; + + va_start (arg_ptr, action); + arg = va_arg (arg_ptr, int); + result = fcntl (fd, action, arg); + /* EPERM for F_DUPFD, ENOTSUP for others */ + if (result == -1 && (errno == EPERM || errno == ENOTSUP) + && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode)) + { + ULONG ulMode; + + switch (action) + { + case F_DUPFD: + /* Find available fd */ + while (fcntl (arg, F_GETFL) != -1 || errno != EBADF) + arg++; + + result = dup2 (fd, arg); + break; + + /* Using underlying APIs is right ? */ + case F_GETFD: + if (DosQueryFHState (fd, &ulMode)) + break; + + result = (ulMode & OPEN_FLAGS_NOINHERIT) ? FD_CLOEXEC : 0; + break; + + case F_SETFD: + if (arg & ~FD_CLOEXEC) + break; + + if (DosQueryFHState (fd, &ulMode)) + break; + + if (arg & FD_CLOEXEC) + ulMode |= OPEN_FLAGS_NOINHERIT; + else + ulMode &= ~OPEN_FLAGS_NOINHERIT; + + /* Filter supported flags. */ + ulMode &= (OPEN_FLAGS_WRITE_THROUGH | OPEN_FLAGS_FAIL_ON_ERROR + | OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_NOINHERIT); + + if (DosSetFHState (fd, ulMode)) + break; + + result = 0; + break; + + case F_GETFL: + result = 0; + break; + + case F_SETFL: + if (arg != 0) + break; + + result = 0; + break; + + default: + errno = EINVAL; + break; + } + } + + va_end (arg_ptr); + + return result; +} + +#endif diff --git a/gnu/fcntl.in.h b/gnu/fcntl.in.h index 00b270c958da282813b00b43eddcf221f717a4ea..eb70dc61eca744ffe29614b969bf666850acd9ed 100644 --- a/gnu/fcntl.in.h +++ b/gnu/fcntl.in.h @@ -1,6 +1,6 @@ /* Like , but with non-working flags defined to 0. - Copyright (C) 2006-2017 Free Software Foundation, Inc. + Copyright (C) 2006-2019 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 @@ -68,7 +68,7 @@ /* Native Windows platforms declare open(), creat() in . */ #if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \ - && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) + && (defined _WIN32 && ! defined __CYGWIN__) # include #endif diff --git a/gnu/fd-hook.c b/gnu/fd-hook.c index 390b64a3076c4e9acb8326f144b9c021ceeca001..78791198fa072b982db441acfcd516c4fa1fbe32 100644 --- a/gnu/fd-hook.c +++ b/gnu/fd-hook.c @@ -1,5 +1,5 @@ /* Hook for making file descriptor functions close(), ioctl() extensible. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2009. This program is free software: you can redistribute it and/or modify it diff --git a/gnu/fd-hook.h b/gnu/fd-hook.h index deaa758236d703d0d33662545f76fd13c5333ee6..bf07f0068b7e55b4a5ef2457e11b2fb392fdd956 100644 --- a/gnu/fd-hook.h +++ b/gnu/fd-hook.h @@ -1,5 +1,5 @@ /* Hook for making file descriptor functions close(), ioctl() extensible. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/fd-safer-flag.c b/gnu/fd-safer-flag.c index 9bfcd2923742d370c906c827e7e64ba150cbd05b..7c026ef54152adc60d36ea0a0d0f072f049a986d 100644 --- a/gnu/fd-safer-flag.c +++ b/gnu/fd-safer-flag.c @@ -1,7 +1,7 @@ /* Adjust a file descriptor result so that it avoids clobbering STD{IN,OUT,ERR}_FILENO, with specific flags. - Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2019 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 diff --git a/gnu/fd-safer.c b/gnu/fd-safer.c index 330203b1f49e758f72c964c6065b91eeec7a98ac..b5113e13673f88fe8812c74d7efa301e78456807 100644 --- a/gnu/fd-safer.c +++ b/gnu/fd-safer.c @@ -1,6 +1,6 @@ /* Return a safer copy of a file descriptor. - Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2019 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 diff --git a/gnu/fdopendir.c b/gnu/fdopendir.c index 7f72258598dd65e222e3e29b2d34b473d1ec4cd6..b65588ac97e5833d33247a5b93ed3b34572c4ad5 100644 --- a/gnu/fdopendir.c +++ b/gnu/fdopendir.c @@ -1,5 +1,5 @@ /* provide a replacement fdopendir function - Copyright (C) 2004-2017 Free Software Foundation, Inc. + Copyright (C) 2004-2019 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 diff --git a/gnu/fdutimensat.c b/gnu/fdutimensat.c index 4041edd1436f6798c711eed5ffb5df9f0344d677..8b4d5e05845937776f63391aa75255a22d76d10f 100644 --- a/gnu/fdutimensat.c +++ b/gnu/fdutimensat.c @@ -1,6 +1,6 @@ /* Set file access and modification times. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 the diff --git a/gnu/file-has-acl.c b/gnu/file-has-acl.c index 1ce71324f3fdae9bdad8948a30c9e8afd566e9da..69a23ad8d92b702b060bbf530d0158c98b158c0f 100644 --- a/gnu/file-has-acl.c +++ b/gnu/file-has-acl.c @@ -1,6 +1,6 @@ /* Test whether a file has a nontrivial ACL. -*- coding: utf-8 -*- - Copyright (C) 2002-2003, 2005-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2019 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 @@ -74,7 +74,7 @@ file_has_acl (char const *name, struct stat const *sb) # elif HAVE_ACL_GET_FILE /* POSIX 1003.1e (draft 17 -- abandoned) specific version. */ - /* Linux, FreeBSD, Mac OS X, IRIX, Tru64 */ + /* Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */ int ret; if (HAVE_ACL_EXTENDED_FILE) /* Linux */ @@ -84,7 +84,7 @@ file_has_acl (char const *name, struct stat const *sb) ACL_TYPE_DEFAULT. */ ret = acl_extended_file (name); } - else /* FreeBSD, Mac OS X, IRIX, Tru64 */ + else /* FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */ { # if HAVE_ACL_TYPE_EXTENDED /* Mac OS X */ /* On Mac OS X, acl_get_file (name, ACL_TYPE_ACCESS) @@ -100,7 +100,7 @@ file_has_acl (char const *name, struct stat const *sb) } else ret = -1; -# else /* FreeBSD, IRIX, Tru64 */ +# else /* FreeBSD, IRIX, Tru64, Cygwin >= 2.5 */ acl_t acl = acl_get_file (name, ACL_TYPE_ACCESS); if (acl) { @@ -114,7 +114,7 @@ file_has_acl (char const *name, struct stat const *sb) /* On OSF/1, acl_get_file (name, ACL_TYPE_DEFAULT) always returns NULL with errno not set. There is no point in making this call. */ -# else /* FreeBSD, IRIX */ +# else /* FreeBSD, IRIX, Cygwin >= 2.5 */ /* On Linux, FreeBSD, IRIX, acl_get_file (name, ACL_TYPE_ACCESS) and acl_get_file (name, ACL_TYPE_DEFAULT) on a directory either both succeed or both fail; it depends on the @@ -125,8 +125,15 @@ file_has_acl (char const *name, struct stat const *sb) acl = acl_get_file (name, ACL_TYPE_DEFAULT); if (acl) { +# ifdef __CYGWIN__ /* Cygwin >= 2.5 */ + ret = acl_access_nontrivial (acl); + saved_errno = errno; + acl_free (acl); + errno = saved_errno; +# else ret = (0 < acl_entries (acl)); acl_free (acl); +# endif } else ret = -1; @@ -141,7 +148,7 @@ file_has_acl (char const *name, struct stat const *sb) return - acl_errno_valid (errno); return ret; -# elif HAVE_FACL && defined GETACL /* Solaris, Cygwin, not HP-UX */ +# elif HAVE_FACL && defined GETACL /* Solaris, Cygwin < 2.5, not HP-UX */ # if defined ACL_NO_TRIVIAL diff --git a/gnu/fileblocks.c b/gnu/fileblocks.c index 4a6eb3324f38548e5da73ed2f0c79c213d35e819..758e7609563663a52df27a3a71f485cbf08a4a2e 100644 --- a/gnu/fileblocks.c +++ b/gnu/fileblocks.c @@ -1,6 +1,6 @@ /* Convert file size to number of blocks on System V-like machines. - Copyright (C) 1990, 1997-1999, 2004-2006, 2009-2017 Free Software + Copyright (C) 1990, 1997-1999, 2004-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/filename.h b/gnu/filename.h index ae4d409c01fb7d1e34b294cab1dd3fd90950698c..3ba31059f696561ae389b4f3806d5aa07ca4cc90 100644 --- a/gnu/filename.h +++ b/gnu/filename.h @@ -1,5 +1,5 @@ /* Basic filename support macros. - Copyright (C) 2001-2004, 2007-2017 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2007-2019 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 @@ -28,7 +28,7 @@ extern "C" { it may be concatenated to a directory pathname. IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. */ -#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ +#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ /* Native Windows, Cygwin, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') # define HAS_DEVICE(P) \ diff --git a/gnu/filenamecat-lgpl.c b/gnu/filenamecat-lgpl.c index 2bd43c0585360e2d16cd71947cce4894762219fe..98b105a150fd9e925dbf06cc39af0ee416013cd0 100644 --- a/gnu/filenamecat-lgpl.c +++ b/gnu/filenamecat-lgpl.c @@ -1,6 +1,6 @@ /* Concatenate two arbitrary file names. - Copyright (C) 1996-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1996-2007, 2009-2019 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 @@ -31,55 +31,54 @@ # define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N))) #endif -/* Return the longest suffix of F that is a relative file name. - If it has no such suffix, return the empty string. */ - -static char const * _GL_ATTRIBUTE_PURE -longest_relative_suffix (char const *f) -{ - for (f += FILE_SYSTEM_PREFIX_LEN (f); ISSLASH (*f); f++) - continue; - return f; -} - -/* Concatenate two file name components, DIR and ABASE, in +/* Concatenate two file name components, DIR and BASE, in newly-allocated storage and return the result. The resulting file name F is such that the commands "ls F" and "(cd - DIR; ls BASE)" refer to the same file, where BASE is ABASE with any - file system prefixes and leading separators removed. - Arrange for a directory separator if necessary between DIR and BASE - in the result, removing any redundant separators. + DIR; ls ./BASE)" refer to the same file. If necessary, put + a separator between DIR and BASE in the result. Typically this + separator is "/", but in rare cases it might be ".". In any case, if BASE_IN_RESULT is non-NULL, set - *BASE_IN_RESULT to point to the copy of ABASE in the returned - concatenation. However, if ABASE begins with more than one slash, - set *BASE_IN_RESULT to point to the sole corresponding slash that - is copied into the result buffer. + *BASE_IN_RESULT to point to the copy of BASE at the end of the + returned concatenation. Return NULL if malloc fails. */ char * -mfile_name_concat (char const *dir, char const *abase, char **base_in_result) +mfile_name_concat (char const *dir, char const *base, char **base_in_result) { char const *dirbase = last_component (dir); size_t dirbaselen = base_len (dirbase); size_t dirlen = dirbase - dir + dirbaselen; - size_t needs_separator = (dirbaselen && ! ISSLASH (dirbase[dirbaselen - 1])); - - char const *base = longest_relative_suffix (abase); size_t baselen = strlen (base); - - char *p_concat = malloc (dirlen + needs_separator + baselen + 1); + char sep = '\0'; + if (dirbaselen) + { + /* DIR is not a file system root, so separate with / if needed. */ + if (! ISSLASH (dir[dirlen - 1]) && ! ISSLASH (*base)) + sep = '/'; + } + else if (ISSLASH (*base)) + { + /* DIR is a file system root and BASE begins with a slash, so + separate with ".". For example, if DIR is "/" and BASE is + "/foo" then return "/./foo", as "//foo" would be wrong on + some POSIX systems. A fancier algorithm could omit "." in + some cases but is not worth the trouble. */ + sep = '.'; + } + + char *p_concat = malloc (dirlen + (sep != '\0') + baselen + 1); char *p; if (p_concat == NULL) return NULL; p = mempcpy (p_concat, dir, dirlen); - *p = DIRECTORY_SEPARATOR; - p += needs_separator; + *p = sep; + p += sep != '\0'; if (base_in_result) - *base_in_result = p - IS_ABSOLUTE_FILE_NAME (abase); + *base_in_result = p; p = mempcpy (p, base, baselen); *p = '\0'; diff --git a/gnu/filenamecat.h b/gnu/filenamecat.h index aa996c18e3ef09ff0725435935046ca338e28edb..67b46b0a5ab400304eff223ce54376cad5bd64ba 100644 --- a/gnu/filenamecat.h +++ b/gnu/filenamecat.h @@ -1,6 +1,6 @@ /* Concatenate two arbitrary file names. - Copyright (C) 1996-1997, 2003, 2005, 2007, 2009-2017 Free Software + Copyright (C) 1996-1997, 2003, 2005, 2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/flexmember.h b/gnu/flexmember.h index 7e4f95d3c89cc3bacc6b527542d5475f90e714d5..0d65f6da60f35712017f06c2155a4fe69791ac1b 100644 --- a/gnu/flexmember.h +++ b/gnu/flexmember.h @@ -1,6 +1,6 @@ /* Sizes of structs with flexible array members. - Copyright 2016-2017 Free Software Foundation, Inc. + Copyright 2016-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/gnu/float+.h b/gnu/float+.h index fb999b978c88801a75f2e75879104120176159f4..5af861f7aeb6ce0079262395f7ae735d077919d0 100644 --- a/gnu/float+.h +++ b/gnu/float+.h @@ -1,5 +1,5 @@ /* Supplemental information about the floating-point formats. - Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2007. This program is free software; you can redistribute it and/or modify diff --git a/gnu/float.c b/gnu/float.c index c4b059feb2bf04d911c49e0e469e0206155f3a84..8872deb59215eec1d0f29eb56d0437471579feb8 100644 --- a/gnu/float.c +++ b/gnu/float.c @@ -1,5 +1,5 @@ /* Auxiliary definitions for . - Copyright (C) 2011-2017 Free Software Foundation, Inc. + Copyright (C) 2011-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2011. This program is free software: you can redistribute it and/or modify diff --git a/gnu/float.in.h b/gnu/float.in.h index e7028e48e696d6cff5054d3b6263b0e2e556f467..ba094a8ef52b523a0f686deaecc193510932de8f 100644 --- a/gnu/float.in.h +++ b/gnu/float.in.h @@ -1,6 +1,6 @@ /* A correct . - Copyright (C) 2007-2017 Free Software Foundation, Inc. + Copyright (C) 2007-2019 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 diff --git a/gnu/fnmatch.c b/gnu/fnmatch.c index 0a7e88796010100da380705ba6955296397a133c..dbcd290691c8a77688168fe5ec8269fee1df0c91 100644 --- a/gnu/fnmatch.c +++ b/gnu/fnmatch.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1993, 1996-2007, 2009-2017 Free Software Foundation, Inc. +/* Copyright (C) 1991-1993, 1996-2007, 2009-2019 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 diff --git a/gnu/fnmatch.in.h b/gnu/fnmatch.in.h index 7e9636b93e83c88a6ec93d331abddee2ee11c162..2ead7828a04b2817b7f4da863f1d094190f96391 100644 --- a/gnu/fnmatch.in.h +++ b/gnu/fnmatch.in.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1991-1993, 1996-1999, 2001-2003, 2005, 2007, 2009-2017 Free +/* Substitute for and wrapper around . + Copyright (C) 1991-1993, 1996-1999, 2001-2003, 2005, 2007, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -16,15 +17,29 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . */ -#ifndef _FNMATCH_H -#define _FNMATCH_H 1 +#ifndef _@GUARD_PREFIX@_FNMATCH_H -/* The definition of _GL_ARG_NONNULL is copied here. */ +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ -#ifdef __cplusplus -extern "C" { +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_FNMATCH_H@ && !@REPLACE_FNMATCH@ +# @INCLUDE_NEXT@ @NEXT_FNMATCH_H@ #endif +#ifndef _@GUARD_PREFIX@_FNMATCH_H +#define _@GUARD_PREFIX@_FNMATCH_H + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +#if !@HAVE_FNMATCH_H@ || @REPLACE_FNMATCH@ + /* We #undef these before defining them because some losing systems (HP-UX A.08.07 for example) define these in . */ #undef FNM_PATHNAME @@ -54,14 +69,42 @@ extern "C" { # define FNM_NOSYS (-1) #endif +#endif + + +#if @GNULIB_FNMATCH@ /* Match NAME against the file name pattern PATTERN, returning zero if it matches, FNM_NOMATCH if not. */ -extern int fnmatch (const char *__pattern, const char *__name, - int __flags) - _GL_ARG_NONNULL ((1, 2)); - -#ifdef __cplusplus -} +# if @REPLACE_FNMATCH@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define fnmatch rpl_fnmatch +# endif +_GL_FUNCDECL_RPL (fnmatch, int, + (const char *pattern, const char *name, int flags) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (fnmatch, int, + (const char *pattern, const char *name, int flags)); +# else +# if !@HAVE_FNMATCH@ +_GL_FUNCDECL_SYS (fnmatch, int, + (const char *pattern, const char *name, int flags) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (fnmatch, int, + (const char *pattern, const char *name, int flags)); +# endif +# if !GNULIB_FNMATCH_GNU +_GL_CXXALIASWARN (fnmatch); +# endif +#elif defined GNULIB_POSIXCHECK +# undef fnmatch +# if HAVE_RAW_DECL_FNMATCH +_GL_WARN_ON_USE (fnmatch, + "fnmatch does not portably work - " + "use gnulib module fnmatch for portability or gnulib module fnmatch-gnu for a glibc compatible implementation"); +# endif #endif -#endif /* fnmatch.h */ + +#endif /* _@GUARD_PREFIX@_FNMATCH_H */ +#endif /* _@GUARD_PREFIX@_FNMATCH_H */ diff --git a/gnu/fnmatch_loop.c b/gnu/fnmatch_loop.c index e2292904de8a95c8341089792044c0c3d560996f..82a7ceed7edfa92c9116b7fa05075b294a5f81b3 100644 --- a/gnu/fnmatch_loop.c +++ b/gnu/fnmatch_loop.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1993, 1996-2006, 2009-2017 Free Software Foundation, Inc. +/* Copyright (C) 1991-1993, 1996-2006, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify diff --git a/gnu/fpending.c b/gnu/fpending.c index 5811a4a74750afdea4b1544d8d7de6b3a9d44ff3..3c01285bb83751f2961f93c17a24abf690b9ce90 100644 --- a/gnu/fpending.c +++ b/gnu/fpending.c @@ -1,5 +1,5 @@ /* fpending.c -- return the number of pending output bytes on a stream - Copyright (C) 2000, 2004, 2006-2007, 2009-2017 Free Software Foundation, + Copyright (C) 2000, 2004, 2006-2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -24,6 +24,9 @@ #include "stdio-impl.h" +/* This file is not used on systems that already have the __fpending function, + namely glibc >= 2.2, Solaris >= 7, Android API >= 23. */ + /* Return the number of pending (aka buffered, unflushed) bytes on the stream, FP, that is open for writing. */ size_t @@ -32,7 +35,8 @@ __fpending (FILE *fp) /* Most systems provide FILE as a struct and the necessary bitmask in , because they need it for implementing getc() and putc() as fast macros. */ -#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 */ return fp->_IO_write_ptr - fp->_IO_write_base; #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ diff --git a/gnu/fpending.h b/gnu/fpending.h index 73c7d795c180ec8ffce8144a9ef528eff7edec45..097a3ef0717faf628922922a8b030906abae2326 100644 --- a/gnu/fpending.h +++ b/gnu/fpending.h @@ -1,6 +1,6 @@ /* Declare __fpending. - Copyright (C) 2000, 2003, 2005-2006, 2009-2017 Free Software Foundation, + Copyright (C) 2000, 2003, 2005-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/fprintftime.h b/gnu/fprintftime.h index 88f1d242eeca2b23d42774d5e9e1d7d1056d5473..d598d1e0f79004d0576020cb2cb35ed7731f10ba 100644 --- a/gnu/fprintftime.h +++ b/gnu/fprintftime.h @@ -1,6 +1,6 @@ /* Generate time strings directly to the output. */ -/* Copyright (C) 2005, 2009-2017 Free Software Foundation, Inc. +/* Copyright (C) 2005, 2009-2019 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 diff --git a/gnu/fseek.c b/gnu/fseek.c index 21dbd53f3cf73f1cf19e4407179e874c92a4d1d3..bb22fe085ba1342e5f3b3bcf4ebac2cb03259a70 100644 --- a/gnu/fseek.c +++ b/gnu/fseek.c @@ -1,5 +1,5 @@ /* An fseek() function that, together with fflush(), is POSIX compliant. - Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2019 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 diff --git a/gnu/fseeko.c b/gnu/fseeko.c index d0f24d8a838fa0a636a8ca6bd62168464cb688b8..859d212bbe153dca6b587db90baae567373084a8 100644 --- a/gnu/fseeko.c +++ b/gnu/fseeko.c @@ -1,5 +1,5 @@ /* An fseeko() function that, together with fflush(), is POSIX compliant. - Copyright (C) 2007-2017 Free Software Foundation, Inc. + Copyright (C) 2007-2019 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 @@ -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,7 +47,8 @@ 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) @@ -123,7 +124,8 @@ fseeko (FILE *fp, off_t offset, int whence) 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__ diff --git a/gnu/fstat.c b/gnu/fstat.c index 7ab2cdcb92829d9c9d4da3b6d5450f0ce8908a80..4f0e618810469344efdff56bbe702609c61c8cf0 100644 --- a/gnu/fstat.c +++ b/gnu/fstat.c @@ -1,5 +1,5 @@ /* fstat() replacement. - Copyright (C) 2011-2017 Free Software Foundation, Inc. + Copyright (C) 2011-2019 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 @@ -25,7 +25,7 @@ #include #undef __need_system_sys_stat_h -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ # define WINDOWS_NATIVE #endif @@ -45,6 +45,8 @@ orig_fstat (int fd, struct stat *buf) above. */ #include "sys/stat.h" +#include "stat-time.h" + #include #include #ifdef WINDOWS_NATIVE @@ -83,6 +85,6 @@ rpl_fstat (int fd, struct stat *buf) } return _gl_fstat_by_handle (h, NULL, buf); #else - return orig_fstat (fd, buf); + return stat_time_normalize (orig_fstat (fd, buf), buf); #endif } diff --git a/gnu/fstatat.c b/gnu/fstatat.c index 294861f51b1952ed3982cb01b3919a2cc054b468..515b569399190311ce1d298eda75000d9764e3fd 100644 --- a/gnu/fstatat.c +++ b/gnu/fstatat.c @@ -1,6 +1,6 @@ /* Work around an fstatat bug on Solaris 9. - Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2019 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 @@ -41,6 +41,8 @@ orig_fstatat (int fd, char const *filename, struct stat *buf, int flags) above. */ #include "sys/stat.h" +#include "stat-time.h" + #include #include #include @@ -51,6 +53,12 @@ orig_fstatat (int fd, char const *filename, struct stat *buf, int flags) # define LSTAT_FOLLOWS_SLASHED_SYMLINK 0 # endif +static int +normal_fstatat (int fd, char const *file, struct stat *st, int flag) +{ + return stat_time_normalize (orig_fstatat (fd, file, st, flag), st); +} + /* fstatat should always follow symbolic links that end in /, but on Solaris 9 it doesn't if AT_SYMLINK_NOFOLLOW is specified. Likewise, trailing slash on a non-directory should be an error. @@ -63,7 +71,7 @@ orig_fstatat (int fd, char const *filename, struct stat *buf, int flags) int rpl_fstatat (int fd, char const *file, struct stat *st, int flag) { - int result = orig_fstatat (fd, file, st, flag); + int result = normal_fstatat (fd, file, st, flag); size_t len; if (LSTAT_FOLLOWS_SLASHED_SYMLINK || result != 0) @@ -79,7 +87,7 @@ rpl_fstatat (int fd, char const *file, struct stat *st, int flag) errno = ENOTDIR; return -1; } - result = orig_fstatat (fd, file, st, flag & ~AT_SYMLINK_NOFOLLOW); + result = normal_fstatat (fd, file, st, flag & ~AT_SYMLINK_NOFOLLOW); } /* Fix stat behavior. */ if (result == 0 && !S_ISDIR (st->st_mode) && file[len - 1] == '/') diff --git a/gnu/full-write.c b/gnu/full-write.c index 338b94244f63ad90229f3210f9bdb68ef29b956a..ec6f81046ec6a7fbf667049e5a883efe6911cad5 100644 --- a/gnu/full-write.c +++ b/gnu/full-write.c @@ -1,6 +1,6 @@ /* An interface to read and write that retries (if necessary) until complete. - Copyright (C) 1993-1994, 1997-2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1993-1994, 1997-2006, 2009-2019 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 diff --git a/gnu/full-write.h b/gnu/full-write.h index bc0f162ffba6fb1a41812cecff2d7e48214b3a90..0e0be3a34a783bc334041f4436855140bd81ce9f 100644 --- a/gnu/full-write.h +++ b/gnu/full-write.h @@ -1,6 +1,6 @@ /* An interface to write() that writes all it is asked to write. - Copyright (C) 2002-2003, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2009-2019 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 diff --git a/gnu/futimens.c b/gnu/futimens.c index 6c3039262f771532ad4176f7f7dff6559129307b..cc03796c754d758a22f441f789ed230cec03ee31 100644 --- a/gnu/futimens.c +++ b/gnu/futimens.c @@ -1,5 +1,5 @@ /* Set the access and modification time of an open fd. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/get-permissions.c b/gnu/get-permissions.c index c54d71c1c568e4623ec3c4b0cb6f911716c692d9..99b4664aae76122c561d9bb8f200f56d75a3b9de 100644 --- a/gnu/get-permissions.c +++ b/gnu/get-permissions.c @@ -1,6 +1,6 @@ /* Get permissions of a file. -*- coding: utf-8 -*- - Copyright (C) 2002-2003, 2005-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2019 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 @@ -31,16 +31,16 @@ int get_permissions (const char *name, int desc, mode_t mode, - struct permission_context *ctx) + struct permission_context *ctx) { memset (ctx, 0, sizeof *ctx); ctx->mode = mode; #if USE_ACL && HAVE_ACL_GET_FILE /* POSIX 1003.1e (draft 17 -- abandoned) specific version. */ - /* Linux, FreeBSD, Mac OS X, IRIX, Tru64 */ + /* Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */ # if !HAVE_ACL_TYPE_EXTENDED - /* Linux, FreeBSD, IRIX, Tru64 */ + /* Linux, FreeBSD, IRIX, Tru64, Cygwin >= 2.5 */ if (HAVE_ACL_GET_FD && desc != -1) ctx->acl = acl_get_fd (desc); @@ -57,16 +57,16 @@ get_permissions (const char *name, int desc, mode_t mode, { ctx->default_acl = acl_get_file (name, ACL_TYPE_DEFAULT); if (ctx->default_acl == NULL) - return -1; + return -1; } -# if HAVE_ACL_TYPE_NFS4 /* FreeBSD */ +# if HAVE_ACL_TYPE_NFS4 /* FreeBSD */ /* TODO (see set_permissions). */ -# endif +# endif -# else /* HAVE_ACL_TYPE_EXTENDED */ +# else /* HAVE_ACL_TYPE_EXTENDED */ /* Mac OS X */ /* On Mac OS X, acl_get_file (name, ACL_TYPE_ACCESS) @@ -115,16 +115,16 @@ get_permissions (const char *name, int desc, mode_t mode, int ret; if (desc != -1) - ret = facl (desc, ACE_GETACLCNT, 0, NULL); + ret = facl (desc, ACE_GETACLCNT, 0, NULL); else - ret = acl (name, ACE_GETACLCNT, 0, NULL); + ret = acl (name, ACE_GETACLCNT, 0, NULL); if (ret < 0) - { - if (errno == ENOSYS || errno == EINVAL) - ret = 0; - else - return -1; - } + { + if (errno == ENOSYS || errno == EINVAL) + ret = 0; + else + return -1; + } ctx->ace_count = ret; if (ctx->ace_count == 0) @@ -138,15 +138,15 @@ get_permissions (const char *name, int desc, mode_t mode, } if (desc != -1) - ret = facl (desc, ACE_GETACL, ctx->ace_count, ctx->ace_entries); + ret = facl (desc, ACE_GETACL, ctx->ace_count, ctx->ace_entries); else - ret = acl (name, ACE_GETACL, ctx->ace_count, ctx->ace_entries); + ret = acl (name, ACE_GETACL, ctx->ace_count, ctx->ace_entries); if (ret < 0) { if (errno == ENOSYS || errno == EINVAL) { - free (ctx->ace_entries); - ctx->ace_entries = NULL; + free (ctx->ace_entries); + ctx->ace_entries = NULL; ctx->ace_count = 0; break; } @@ -154,10 +154,10 @@ get_permissions (const char *name, int desc, mode_t mode, return -1; } if (ret <= ctx->ace_count) - { - ctx->ace_count = ret; - break; - } + { + ctx->ace_count = ret; + break; + } /* Huh? The number of ACL entries has increased since the last call. Repeat. */ free (ctx->ace_entries); @@ -170,20 +170,20 @@ get_permissions (const char *name, int desc, mode_t mode, int ret; if (desc != -1) - ret = facl (desc, GETACLCNT, 0, NULL); + ret = facl (desc, GETACLCNT, 0, NULL); else - ret = acl (name, GETACLCNT, 0, NULL); + ret = acl (name, GETACLCNT, 0, NULL); if (ret < 0) - { - if (errno == ENOSYS || errno == ENOTSUP || errno == EOPNOTSUPP) - ret = 0; - else - return -1; - } + { + if (errno == ENOSYS || errno == ENOTSUP || errno == EOPNOTSUPP) + ret = 0; + else + return -1; + } ctx->count = ret; if (ctx->count == 0) - break; + break; ctx->entries = (aclent_t *) malloc (ctx->count * sizeof (aclent_t)); if (ctx->entries == NULL) @@ -193,26 +193,26 @@ get_permissions (const char *name, int desc, mode_t mode, } if (desc != -1) - ret = facl (desc, GETACL, ctx->count, ctx->entries); + ret = facl (desc, GETACL, ctx->count, ctx->entries); else - ret = acl (name, GETACL, ctx->count, ctx->entries); + ret = acl (name, GETACL, ctx->count, ctx->entries); if (ret < 0) - { - if (errno == ENOSYS || errno == ENOTSUP || errno == EOPNOTSUPP) - { - free (ctx->entries); - ctx->entries = NULL; - ctx->count = 0; - break; - } - else - return -1; - } + { + if (errno == ENOSYS || errno == ENOTSUP || errno == EOPNOTSUPP) + { + free (ctx->entries); + ctx->entries = NULL; + ctx->count = 0; + break; + } + else + return -1; + } if (ret <= ctx->count) - { - ctx->count = ret; - break; - } + { + ctx->count = ret; + break; + } /* Huh? The number of ACL entries has increased since the last call. Repeat. */ free (ctx->entries); diff --git a/gnu/getcwd-lgpl.c b/gnu/getcwd-lgpl.c index 3aaab32bca97e66e624b5af5c7eab000176b2f18..b224cfc9d109ce0d715e66d7a07e872d748277bf 100644 --- a/gnu/getcwd-lgpl.c +++ b/gnu/getcwd-lgpl.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2011-2017 Free Software Foundation, Inc. +/* Copyright (C) 2011-2019 Free Software Foundation, Inc. This file is part of gnulib. This program is free software: you can redistribute it and/or modify diff --git a/gnu/getcwd.c b/gnu/getcwd.c index bb13ddedb30974500b9754062dcd69fdeedf6877..41eedb7005aa8aada1325d62de97c492a8f75b38 100644 --- a/gnu/getcwd.c +++ b/gnu/getcwd.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1999, 2004-2017 Free Software Foundation, Inc. +/* Copyright (C) 1991-1999, 2004-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff --git a/gnu/getdelim.c b/gnu/getdelim.c index 83cc2b0894082b552389e46d382b172d9cbee9a8..528678c2526002536d2ff81e3255ae573a61a13d 100644 --- a/gnu/getdelim.c +++ b/gnu/getdelim.c @@ -1,5 +1,5 @@ /* getdelim.c --- Implementation of replacement getdelim function. - Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2017 Free Software + Copyright (C) 1994, 1996-1998, 2001, 2003, 2005-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or @@ -50,7 +50,7 @@ static void alloc_failed (void) { -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ /* Avoid errno problem without using the realloc module; see: https://lists.gnu.org/r/bug-gnulib/2016-08/msg00025.html */ errno = ENOMEM; diff --git a/gnu/getdtablesize.c b/gnu/getdtablesize.c index d0a5ecaf5d609da83377fb113a75fa5e66b5d1fb..03a92435f0b3b5bbe4fe27cdda200de049a5912d 100644 --- a/gnu/getdtablesize.c +++ b/gnu/getdtablesize.c @@ -1,5 +1,5 @@ /* getdtablesize() function: Return maximum possible file descriptor value + 1. - Copyright (C) 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify @@ -20,7 +20,7 @@ /* Specification. */ #include -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ # include diff --git a/gnu/getfilecon.c b/gnu/getfilecon.c index 0067dbd297a3dfe6cc8e133166eebe274cd6d6e8..713896de6199a10196506cdaca9a2e0e1073a69a 100644 --- a/gnu/getfilecon.c +++ b/gnu/getfilecon.c @@ -1,5 +1,5 @@ /* wrap getfilecon, lgetfilecon, and fgetfilecon - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/getgroups.c b/gnu/getgroups.c index 52473a5a230f93ed3b3e94d3d1f3f6cfa628ac06..d8c77e9a650654d8e687f6eeafa917987bf09181 100644 --- a/gnu/getgroups.c +++ b/gnu/getgroups.c @@ -1,6 +1,6 @@ /* provide consistent interface to getgroups for systems that don't allow N==0 - Copyright (C) 1996, 1999, 2003, 2006-2017 Free Software Foundation, Inc. + Copyright (C) 1996, 1999, 2003, 2006-2019 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 @@ -58,8 +58,8 @@ int posix_getgroups (int, gid_t []) __asm ("_getgroups"); # define getgroups posix_getgroups # endif -/* On at least Ultrix 4.3 and NextStep 3.2, getgroups (0, NULL) always - fails. On other systems, it returns the number of supplemental +/* On at least NeXTstep 3.2, getgroups (0, NULL) always fails. + On other systems, it returns the number of supplemental groups for the process. This function handles that special case and lets the system-provided function handle all others. However, it can fail with ENOMEM if memory is tight. It is unspecified diff --git a/gnu/getline.c b/gnu/getline.c index 92a2543874c2d36eb0d629e3d6c45b291b168f69..40882fb218588a992f728256f3e4b84ba4e16d0e 100644 --- a/gnu/getline.c +++ b/gnu/getline.c @@ -1,5 +1,5 @@ /* getline.c --- Implementation of replacement getline function. - Copyright (C) 2005-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2005-2007, 2009-2019 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 diff --git a/gnu/getopt-cdefs.in.h b/gnu/getopt-cdefs.in.h index 83a18f9a75e76cb069ac73d2835e923ea037d05e..049145b38699d4a6a72371ad51141c7479ac6265 100644 --- a/gnu/getopt-cdefs.in.h +++ b/gnu/getopt-cdefs.in.h @@ -1,5 +1,5 @@ /* getopt-on-non-glibc compatibility macros. - Copyright (C) 1989-2017 Free Software Foundation, Inc. + Copyright (C) 1989-2019 Free Software Foundation, Inc. This file is part of gnulib. Unlike most of the getopt implementation, it is NOT shared with the GNU C Library. diff --git a/gnu/getopt-core.h b/gnu/getopt-core.h index ec0734c7230962fd8d3ca31f33924cb21af8eb42..6360ad6942e41b57b164c7eb5ecabfb0c7a1ad66 100644 --- a/gnu/getopt-core.h +++ b/gnu/getopt-core.h @@ -1,5 +1,5 @@ /* Declarations for getopt (basic, portable features only). - Copyright (C) 1989-2017 Free Software Foundation, Inc. + Copyright (C) 1989-2019 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff --git a/gnu/getopt-ext.h b/gnu/getopt-ext.h index 4cdbfb0e7a52c306ca0b526ae31f50cb229494a0..13cb0077beff344211a97e77ea9e6525406f4e3b 100644 --- a/gnu/getopt-ext.h +++ b/gnu/getopt-ext.h @@ -1,5 +1,5 @@ /* Declarations for getopt (GNU extensions). - Copyright (C) 1989-2017 Free Software Foundation, Inc. + Copyright (C) 1989-2019 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff --git a/gnu/getopt-pfx-core.h b/gnu/getopt-pfx-core.h index 02b2b5064d33b46a87e67e0c1d6d149ccfc859d5..8fac2691e8587bc017ba1ec5cd47b99f291874ca 100644 --- a/gnu/getopt-pfx-core.h +++ b/gnu/getopt-pfx-core.h @@ -1,5 +1,5 @@ /* getopt (basic, portable features) gnulib wrapper header. - Copyright (C) 1989-2017 Free Software Foundation, Inc. + Copyright (C) 1989-2019 Free Software Foundation, Inc. This file is part of gnulib. Unlike most of the getopt implementation, it is NOT shared with the GNU C Library. diff --git a/gnu/getopt-pfx-ext.h b/gnu/getopt-pfx-ext.h index 75e6fd32fe08f82eac6b4783e9b609d4a1166c39..0e21aefb0b7c8096a86caeb913b3c458be98bd1a 100644 --- a/gnu/getopt-pfx-ext.h +++ b/gnu/getopt-pfx-ext.h @@ -1,5 +1,5 @@ /* getopt (GNU extensions) gnulib wrapper header. - Copyright (C) 1989-2017 Free Software Foundation, Inc. + Copyright (C) 1989-2019 Free Software Foundation, Inc. This file is part of gnulib. Unlike most of the getopt implementation, it is NOT shared with the GNU C Library. diff --git a/gnu/getopt.c b/gnu/getopt.c index b0cc35bfb1bedf0bdcb5876ecfcbd99f09cd4c25..8ee075a8091ca804571e6afe611f984cf7bb05a7 100644 --- a/gnu/getopt.c +++ b/gnu/getopt.c @@ -1,5 +1,5 @@ /* Getopt for GNU. - Copyright (C) 1987-2017 Free Software Foundation, Inc. + Copyright (C) 1987-2019 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. @@ -46,7 +46,7 @@ /* When used standalone, flockfile and funlockfile might not be available. */ # if (!defined _POSIX_THREAD_SAFE_FUNCTIONS \ - || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) + || (defined _WIN32 && ! defined __CYGWIN__)) # define flockfile(fp) /* nop */ # define funlockfile(fp) /* nop */ # endif diff --git a/gnu/getopt.in.h b/gnu/getopt.in.h index 594ed8092a1b50e35b7540139bccd17cf35a0606..c77f34ce587a24dc6c64662b2fe654e497939a1a 100644 --- a/gnu/getopt.in.h +++ b/gnu/getopt.in.h @@ -1,5 +1,5 @@ /* Declarations for getopt. - Copyright (C) 1989-2017 Free Software Foundation, Inc. + Copyright (C) 1989-2019 Free Software Foundation, Inc. This file is part of gnulib. Unlike most of the getopt implementation, it is NOT shared with the GNU C Library, which supplies a different version of diff --git a/gnu/getopt1.c b/gnu/getopt1.c index d689f4ce67aeec10022b70e9452e8958a6ff579b..883aa6bbc91694b789d9a46996a611c2123aa8c0 100644 --- a/gnu/getopt1.c +++ b/gnu/getopt1.c @@ -1,5 +1,5 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987-2017 Free Software Foundation, Inc. + Copyright (C) 1987-2019 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff --git a/gnu/getopt_int.h b/gnu/getopt_int.h index e33856ce9b9b6b303c930c15115dc1891762af1d..e63706f60ea3eaec4fcce644ebb2b005a6d75e97 100644 --- a/gnu/getopt_int.h +++ b/gnu/getopt_int.h @@ -1,5 +1,5 @@ /* Internal declarations for getopt. - Copyright (C) 1989-2017 Free Software Foundation, Inc. + Copyright (C) 1989-2019 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff --git a/gnu/getpagesize.c b/gnu/getpagesize.c index 4594a4a8b514d6a0f15a88d33af843a3d2d94dd9..3a698292bce9d6f3a459bd1b673e18d72caf7e95 100644 --- a/gnu/getpagesize.c +++ b/gnu/getpagesize.c @@ -1,6 +1,6 @@ /* getpagesize emulation for systems where it cannot be done in a C macro. - Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2019 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 @@ -23,7 +23,7 @@ #include /* This implementation is only for native Windows systems. */ -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ # define WIN32_LEAN_AND_MEAN # include diff --git a/gnu/getprogname.c b/gnu/getprogname.c index a2b23362b22239fbccf9593e2d72823af2f325f2..96fa759613549b00fbcadce636f99bd5d2b7707f 100644 --- a/gnu/getprogname.c +++ b/gnu/getprogname.c @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2016-2017 Free Software Foundation, Inc. + Copyright (C) 2016-2019 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 @@ -110,9 +110,73 @@ getprogname (void) first = 0; pid_t pid = getpid (); struct pst_status status; - p = (0 < pstat_getproc (&status, sizeof status, 0, pid) - ? strdup (status.pst_ucomm) - : NULL); + if (pstat_getproc (&status, sizeof status, 0, pid) > 0) + { + char *ucomm = status.pst_ucomm; + char *cmd = status.pst_cmd; + if (strlen (ucomm) < PST_UCOMMLEN - 1) + p = ucomm; + else + { + /* ucomm is truncated to length PST_UCOMMLEN - 1. + Look at cmd instead. */ + char *space = strchr (cmd, ' '); + if (space != NULL) + *space = '\0'; + p = strrchr (cmd, '/'); + if (p != NULL) + p++; + else + p = cmd; + if (strlen (p) > PST_UCOMMLEN - 1 + && memcmp (p, ucomm, PST_UCOMMLEN - 1) == 0) + /* p is less truncated than ucomm. */ + ; + else + p = ucomm; + } + p = strdup (p); + } + else + { +# if !defined __LP64__ + /* Support for 32-bit programs running in 64-bit HP-UX. + The documented way to do this is to use the same source code + as above, but in a compilation unit where '#define _PSTAT64 1' + is in effect. I prefer a single compilation unit; the struct + size and the offsets are not going to change. */ + char status64[1216]; + if (__pstat_getproc64 (status64, sizeof status64, 0, pid) > 0) + { + char *ucomm = status64 + 288; + char *cmd = status64 + 168; + if (strlen (ucomm) < PST_UCOMMLEN - 1) + p = ucomm; + else + { + /* ucomm is truncated to length PST_UCOMMLEN - 1. + Look at cmd instead. */ + char *space = strchr (cmd, ' '); + if (space != NULL) + *space = '\0'; + p = strrchr (cmd, '/'); + if (p != NULL) + p++; + else + p = cmd; + if (strlen (p) > PST_UCOMMLEN - 1 + && memcmp (p, ucomm, PST_UCOMMLEN - 1) == 0) + /* p is less truncated than ucomm. */ + ; + else + p = ucomm; + } + p = strdup (p); + } + else +# endif + p = NULL; + } if (!p) p = "?"; } @@ -182,3 +246,10 @@ getprogname (void) } #endif + +/* + * Hey Emacs! + * Local Variables: + * coding: utf-8 + * End: + */ diff --git a/gnu/getprogname.h b/gnu/getprogname.h index dd5fac840d2b2c658f90754020fb2038b933e8a6..1590b38d3f143bb69ef752defa4dea800db457d8 100644 --- a/gnu/getprogname.h +++ b/gnu/getprogname.h @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2016-2017 Free Software Foundation, Inc. + Copyright (C) 2016-2019 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 diff --git a/gnu/gettext.h b/gnu/gettext.h index f6150be6523d154b14f61800f6ab0b1ad7990c2a..89f53d917bbc73a6a7e2fa3b7fc8c955db8ef1a1 100644 --- a/gnu/gettext.h +++ b/gnu/gettext.h @@ -1,5 +1,5 @@ /* Convenience header for conditional use of GNU . - Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2017 Free Software + Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -185,7 +185,7 @@ npgettext_aux (const char *domain, #include #if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \ - /* || __STDC_VERSION__ == 199901L + /* || (__STDC_VERSION__ == 199901L && !defined __HP_cc) || (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */ ) # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1 #else diff --git a/gnu/gettime.c b/gnu/gettime.c index e5af26c9902859c7075ef0280ba0c11b46ac62f7..1fd153f6dceba507d7e7f7bc60366c09ee544178 100644 --- a/gnu/gettime.c +++ b/gnu/gettime.c @@ -1,6 +1,6 @@ /* gettime -- get the system clock - Copyright (C) 2002, 2004-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2002, 2004-2007, 2009-2019 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 @@ -28,21 +28,22 @@ void gettime (struct timespec *ts) { -#if HAVE_NANOTIME - nanotime (ts); +#if defined CLOCK_REALTIME && HAVE_CLOCK_GETTIME + clock_gettime (CLOCK_REALTIME, ts); #else + struct timeval tv; + gettimeofday (&tv, NULL); + ts->tv_sec = tv.tv_sec; + ts->tv_nsec = tv.tv_usec * 1000; +#endif +} -# if defined CLOCK_REALTIME && HAVE_CLOCK_GETTIME - if (clock_gettime (CLOCK_REALTIME, ts) == 0) - return; -# endif - - { - struct timeval tv; - gettimeofday (&tv, NULL); - ts->tv_sec = tv.tv_sec; - ts->tv_nsec = tv.tv_usec * 1000; - } +/* Return the current system time as a struct timespec. */ -#endif +struct timespec +current_timespec (void) +{ + struct timespec ts; + gettime (&ts); + return ts; } diff --git a/gnu/gettimeofday.c b/gnu/gettimeofday.c index a11b1830c4c5667ef6c1317c67ddc04646145cb6..360cdc4d7932044d952f0b71bcf88d6e6e3f3307 100644 --- a/gnu/gettimeofday.c +++ b/gnu/gettimeofday.c @@ -1,6 +1,6 @@ /* Provide gettimeofday for systems that don't have it or for which it's broken. - Copyright (C) 2001-2003, 2005-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2007, 2009-2019 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 @@ -24,7 +24,7 @@ #include -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ # define WINDOWS_NATIVE # include #endif @@ -33,6 +33,10 @@ #ifdef WINDOWS_NATIVE +/* Avoid warnings from gcc -Wcast-function-type. */ +# define GetProcAddress \ + (void *) GetProcAddress + /* GetSystemTimePreciseAsFileTime was introduced only in Windows 8. */ typedef void (WINAPI * GetSystemTimePreciseAsFileTimeFuncType) (FILETIME *lpTime); static GetSystemTimePreciseAsFileTimeFuncType GetSystemTimePreciseAsFileTimeFunc = NULL; @@ -45,7 +49,7 @@ initialize (void) if (kernel32 != NULL) { GetSystemTimePreciseAsFileTimeFunc = - (GetSystemTimePreciseAsFileTimeFuncType) GetProcAddress (kernel32, "GetSystemTimePreciseAsFileTime"); + (GetSystemTimePreciseAsFileTimeFuncType) GetProcAddress (kernel32, "GetSystemTimePreciseAsFileTime"); } initialized = TRUE; } diff --git a/gnu/group-member.c b/gnu/group-member.c index 7c4ce49675362c26b7572e29853540bb37826c2d..ad61cf0b63025aa912c7f7a509cdaa45d529037b 100644 --- a/gnu/group-member.c +++ b/gnu/group-member.c @@ -1,6 +1,6 @@ /* group-member.c -- determine whether group id is in calling user's group list - Copyright (C) 1994, 1997-1998, 2003, 2005-2006, 2009-2017 Free Software + Copyright (C) 1994, 1997-1998, 2003, 2005-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/hard-locale.c b/gnu/hard-locale.c index 12a3512e180bf7a5ef20f8dd3155bc8dae59291f..dcfcad62ee7cf86204109b07a7c358e829e9ba94 100644 --- a/gnu/hard-locale.c +++ b/gnu/hard-locale.c @@ -1,6 +1,6 @@ /* hard-locale.c -- Determine whether a locale is hard. - Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2017 Free Software + Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/hard-locale.h b/gnu/hard-locale.h index 7f8533d7640fa239e45734cd1f0450f40111b41d..8f1da96e2f252abf418f41c721b732724f1fcb23 100644 --- a/gnu/hard-locale.h +++ b/gnu/hard-locale.h @@ -1,6 +1,6 @@ /* Determine whether a locale is hard. - Copyright (C) 1999, 2003-2004, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1999, 2003-2004, 2009-2019 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 diff --git a/gnu/hash.c b/gnu/hash.c index 6e7a4af3c9aa80a73214c76559caf15d8802b91d..9e1f8e8417eb2255c542223dc583efac6e78af59 100644 --- a/gnu/hash.c +++ b/gnu/hash.c @@ -1,6 +1,6 @@ /* hash - hashing table processing. - Copyright (C) 1998-2004, 2006-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1998-2004, 2006-2007, 2009-2019 Free Software Foundation, Inc. Written by Jim Meyering, 1992. diff --git a/gnu/hash.h b/gnu/hash.h index faac4685d8b7dc6d77a1b0248c42ba5bae601fe4..a1a483a35941bcbc644e56709b0a0e35ed7a130b 100644 --- a/gnu/hash.h +++ b/gnu/hash.h @@ -1,5 +1,5 @@ /* hash - hashing table processing. - Copyright (C) 1998-1999, 2001, 2003, 2009-2017 Free Software Foundation, + Copyright (C) 1998-1999, 2001, 2003, 2009-2019 Free Software Foundation, Inc. Written by Jim Meyering , 1998. diff --git a/gnu/human.c b/gnu/human.c index e472501949d25855a0bbea6eb91a738afe8d56cb..fbfa206004a230d4e428b0d9ab9c77f3fd27f323 100644 --- a/gnu/human.c +++ b/gnu/human.c @@ -1,6 +1,6 @@ /* human.c -- print human readable file size - Copyright (C) 1996-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1996-2007, 2009-2019 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 diff --git a/gnu/human.h b/gnu/human.h index a87b6f2f66bf7a8aa49afb576db5a41fb89e386a..31a47377e6d5aba2d7ac4b1ecf7674752840e546 100644 --- a/gnu/human.h +++ b/gnu/human.h @@ -1,6 +1,6 @@ /* human.h -- print human readable file size - Copyright (C) 1996-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1996-2007, 2009-2019 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 diff --git a/gnu/intprops.h b/gnu/intprops.h index 2df7b1f9f69afdfca3bab94b01fe3b8390a511e3..1a44ae5565373cabbbd2fd032f4c0ccff4265e78 100644 --- a/gnu/intprops.h +++ b/gnu/intprops.h @@ -1,6 +1,6 @@ /* intprops.h -- properties of integer types - Copyright (C) 2001-2017 Free Software Foundation, Inc. + Copyright (C) 2001-2019 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 @@ -22,12 +22,13 @@ #include -/* Return a value with the common real type of E and V and the value of V. */ -#define _GL_INT_CONVERT(e, v) (0 * (e) + (v)) +/* Return a value with the common real type of E and V and the value of V. + Do not evaluate E. */ +#define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v)) /* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see . */ -#define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v)) +#define _GL_INT_NEGATE_CONVERT(e, v) ((1 ? 0 : (e)) - (v)) /* The extra casts in the following macros work around compiler bugs, e.g., in Cray C 5.0.3.0. */ @@ -40,13 +41,14 @@ #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) /* Return 1 if the real expression E, after promotion, has a - signed or floating type. */ + signed or floating type. Do not evaluate E. */ #define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0) /* Minimum and maximum values for integer types and expressions. */ /* The width in bits of the integer type or expression T. + Do not evaluate T. Padding bits are not supported; this is checked at compile-time below. */ #define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) @@ -58,7 +60,7 @@ : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1))) /* The maximum and minimum values for the type of the expression E, - after integer promotion. E should not have side effects. */ + after integer promotion. E is not evaluated. */ #define _GL_INT_MINIMUM(e) \ (EXPR_SIGNED (e) \ ? ~ _GL_SIGNED_INT_MAXIMUM (e) \ @@ -340,8 +342,8 @@ Arguments should be free of side effects. */ #define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \ op_result_overflow (a, b, \ - _GL_INT_MINIMUM (0 * (b) + (a)), \ - _GL_INT_MAXIMUM (0 * (b) + (a))) + _GL_INT_MINIMUM (_GL_INT_CONVERT (a, b)), \ + _GL_INT_MAXIMUM (_GL_INT_CONVERT (a, b))) /* Store the low-order bits of A + B, A - B, A * B, respectively, into *R. Return 1 if the result overflows. See above for restrictions. */ diff --git a/gnu/inttostr.h b/gnu/inttostr.h index 680b84b11686765277ddf8e49c87ed7223522568..7cb677489d08f8784a27a997dec2dcdc9f00b4f3 100644 --- a/gnu/inttostr.h +++ b/gnu/inttostr.h @@ -1,6 +1,6 @@ /* inttostr.h -- convert integers to printable strings - Copyright (C) 2001-2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2001-2006, 2009-2019 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 diff --git a/gnu/inttypes.in.h b/gnu/inttypes.in.h index e7357e96accddbac1ec33d246785a3a67b65b98a..d3c735c12ce2b1ec1afdb15d2a9dd6ce6d8f6d93 100644 --- a/gnu/inttypes.in.h +++ b/gnu/inttypes.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006-2017 Free Software Foundation, Inc. +/* Copyright (C) 2006-2019 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Derek Price. This file is part of gnulib. @@ -52,7 +52,7 @@ /* Get CHAR_BIT. */ #include /* On mingw, __USE_MINGW_ANSI_STDIO only works if is also included */ -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ # include #endif @@ -1067,11 +1067,13 @@ _GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - " #endif #if @GNULIB_IMAXDIV@ -# if !@HAVE_DECL_IMAXDIV@ +# if !@HAVE_IMAXDIV_T@ # if !GNULIB_defined_imaxdiv_t typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t; # define GNULIB_defined_imaxdiv_t 1 # endif +# endif +# if !@HAVE_DECL_IMAXDIV@ extern imaxdiv_t imaxdiv (intmax_t, intmax_t); # endif #elif defined GNULIB_POSIXCHECK diff --git a/gnu/iswblank.c b/gnu/iswblank.c index c3b5b072a6daa38c30b64bfaccdd627c8f537a83..6d7a6dfde88869c84bde0591945dc0da6273aff4 100644 --- a/gnu/iswblank.c +++ b/gnu/iswblank.c @@ -1,5 +1,5 @@ /* Test wide character for being blank. - Copyright (C) 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2008-2019 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 diff --git a/gnu/itold.c b/gnu/itold.c index f787f676bc645524f820fcd860539169aea2ae7f..bca01eb56967ecf51487e8633f087004a0408395 100644 --- a/gnu/itold.c +++ b/gnu/itold.c @@ -1,5 +1,5 @@ /* Replacement for 'int' to 'long double' conversion routine. - Copyright (C) 2011-2017 Free Software Foundation, Inc. + Copyright (C) 2011-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2011. This program is free software: you can redistribute it and/or modify diff --git a/gnu/langinfo.in.h b/gnu/langinfo.in.h index 394737ec694d21cf60c983fb71d873483183fd71..6d4063506d7db210d2b92ca2d93c09a78b193a61 100644 --- a/gnu/langinfo.in.h +++ b/gnu/langinfo.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around . - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 @@ -86,6 +86,18 @@ typedef int nl_item; # define MON_10 (MON_1 + 9) # define MON_11 (MON_1 + 10) # define MON_12 (MON_1 + 11) +# define ALTMON_1 10200 +# define ALTMON_2 (ALTMON_1 + 1) +# define ALTMON_3 (ALTMON_1 + 2) +# define ALTMON_4 (ALTMON_1 + 3) +# define ALTMON_5 (ALTMON_1 + 4) +# define ALTMON_6 (ALTMON_1 + 5) +# define ALTMON_7 (ALTMON_1 + 6) +# define ALTMON_8 (ALTMON_1 + 7) +# define ALTMON_9 (ALTMON_1 + 8) +# define ALTMON_10 (ALTMON_1 + 9) +# define ALTMON_11 (ALTMON_1 + 10) +# define ALTMON_12 (ALTMON_1 + 11) # define ABMON_1 10035 # define ABMON_2 (ABMON_1 + 1) # define ABMON_3 (ABMON_1 + 2) @@ -138,6 +150,22 @@ typedef int nl_item; # define GNULIB_defined_T_FMT_AMPM 1 # endif +# if !@HAVE_LANGINFO_ALTMON@ +# define ALTMON_1 10200 +# define ALTMON_2 (ALTMON_1 + 1) +# define ALTMON_3 (ALTMON_1 + 2) +# define ALTMON_4 (ALTMON_1 + 3) +# define ALTMON_5 (ALTMON_1 + 4) +# define ALTMON_6 (ALTMON_1 + 5) +# define ALTMON_7 (ALTMON_1 + 6) +# define ALTMON_8 (ALTMON_1 + 7) +# define ALTMON_9 (ALTMON_1 + 8) +# define ALTMON_10 (ALTMON_1 + 9) +# define ALTMON_11 (ALTMON_1 + 10) +# define ALTMON_12 (ALTMON_1 + 11) +# define GNULIB_defined_ALTMON 1 +# endif + # if !@HAVE_LANGINFO_ERA@ # define ERA 10047 # define ERA_D_FMT 10048 diff --git a/gnu/lchown.c b/gnu/lchown.c index fff81e0b1a5eeedb49e2e883de761fb97ebd5faf..03138c29bb2514507ac6a38fb03495a619bfcf1f 100644 --- a/gnu/lchown.c +++ b/gnu/lchown.c @@ -1,6 +1,6 @@ /* Provide a stub lchown function for systems that lack it. - Copyright (C) 1998-1999, 2002, 2004, 2006-2007, 2009-2017 Free Software + Copyright (C) 1998-1999, 2002, 2004, 2006-2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/libc-config.h b/gnu/libc-config.h new file mode 100644 index 0000000000000000000000000000000000000000..57c69661d2f2c07a274407b1c3983a11c2677132 --- /dev/null +++ b/gnu/libc-config.h @@ -0,0 +1,174 @@ +/* System definitions for code taken from the GNU C Library + + Copyright 2017-2019 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 the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 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 + . */ + +/* Written by Paul Eggert. */ + +/* This is intended to be a good-enough substitute for glibc system + macros like those defined in , so that Gnulib code + shared with glibc can do this as the first #include: + + #ifndef _LIBC + # include + #endif + + When compiled as part of glibc this is a no-op; when compiled as + part of Gnulib this includes Gnulib's and defines macros + that glibc library code would normally assume. */ + +#include + +/* On glibc this includes and and #defines + _FEATURES_H, __WORDSIZE, and __set_errno. On FreeBSD 11 it + includes which defines __nonnull. Elsewhere it + is harmless. */ +#include + +/* From glibc . */ +#ifndef __set_errno +# define __set_errno(val) (errno = (val)) +#endif + +/* From glibc . */ + +#ifndef __GNUC_PREREQ +# if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) ((maj) < __GNUC__ + ((min) <= __GNUC_MINOR__)) +# else +# define __GNUC_PREREQ(maj, min) 0 +# endif +#endif + +#ifndef __glibc_clang_prereq +# if defined __clang_major__ && defined __clang_minor__ +# define __glibc_clang_prereq(maj, min) \ + ((maj) < __clang_major__ + ((min) <= __clang_minor__)) +# else +# define __glibc_clang_prereq(maj, min) 0 +# endif +#endif + + +/* Prepare to include , which is our copy of glibc + . */ + +/* Define _FEATURES_H so that does not include . */ +#ifndef _FEATURES_H +# define _FEATURES_H 1 +#endif +/* Define __WORDSIZE so that does not attempt to include + nonexistent files. Make it a syntax error, since Gnulib does not + use __WORDSIZE now, and if Gnulib uses it later the syntax error + will let us know that __WORDSIZE needs configuring. */ +#ifndef __WORDSIZE +# define __WORDSIZE %%% +#endif +/* Undef the macros unconditionally defined by our copy of glibc + , so that they do not clash with any system-defined + versions. */ +#undef _SYS_CDEFS_H +#undef __ASMNAME +#undef __ASMNAME2 +#undef __BEGIN_DECLS +#undef __CONCAT +#undef __END_DECLS +#undef __HAVE_GENERIC_SELECTION +#undef __LDBL_COMPAT +#undef __LDBL_REDIR +#undef __LDBL_REDIR1 +#undef __LDBL_REDIR1_DECL +#undef __LDBL_REDIR1_NTH +#undef __LDBL_REDIR_DECL +#undef __LDBL_REDIR_NTH +#undef __LEAF +#undef __LEAF_ATTR +#undef __NTH +#undef __NTHNL +#undef __P +#undef __PMT +#undef __REDIRECT +#undef __REDIRECT_LDBL +#undef __REDIRECT_NTH +#undef __REDIRECT_NTHNL +#undef __REDIRECT_NTH_LDBL +#undef __STRING +#undef __THROW +#undef __THROWNL +#undef __always_inline +#undef __attribute__ +#undef __attribute_alloc_size__ +#undef __attribute_artificial__ +#undef __attribute_const__ +#undef __attribute_deprecated__ +#undef __attribute_deprecated_msg__ +#undef __attribute_format_arg__ +#undef __attribute_format_strfmon__ +#undef __attribute_malloc__ +#undef __attribute_noinline__ +#undef __attribute_nonstring__ +#undef __attribute_pure__ +#undef __attribute_used__ +#undef __attribute_warn_unused_result__ +#undef __bos +#undef __bos0 +#undef __errordecl +#undef __extension__ +#undef __extern_always_inline +#undef __extern_inline +#undef __flexarr +#undef __fortify_function +#undef __glibc_c99_flexarr_available +#undef __glibc_clang_has_extension +#undef __glibc_likely +#undef __glibc_macro_warning +#undef __glibc_macro_warning1 +#undef __glibc_unlikely +#undef __inline +#undef __ptr_t +#undef __restrict +#undef __restrict_arr +#undef __va_arg_pack +#undef __va_arg_pack_len +#undef __warnattr +#undef __warndecl + +/* Include our copy of glibc . */ +#include + +/* __inline is too pessimistic for non-GCC. */ +#undef __inline +#ifndef HAVE___INLINE +# if 199901 <= __STDC_VERSION__ || defined inline +# define __inline inline +# else +# define __inline +# endif +#endif + + +/* A substitute for glibc , good enough for Gnulib. */ +#define attribute_hidden +#define libc_hidden_proto(name, ...) +#define libc_hidden_def(name) +#define libc_hidden_weak(name) +#define libc_hidden_ver(local, name) +#define strong_alias(name, aliasname) +#define weak_alias(name, aliasname) + +/* A substitute for glibc , good enough for Gnulib. */ +#define SHLIB_COMPAT(lib, introduced, obsoleted) 0 +#define versioned_symbol(lib, local, symbol, version) diff --git a/gnu/limits.in.h b/gnu/limits.in.h index 78dcf31037e1457e726a3f26dcdfd18e09bba034..39750b38d1a593b2e1c894225f273f047b07eaf1 100644 --- a/gnu/limits.in.h +++ b/gnu/limits.in.h @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright 2016-2017 Free Software Foundation, Inc. + Copyright 2016-2019 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 @@ -28,15 +28,32 @@ #ifndef _@GUARD_PREFIX@_LIMITS_H #define _@GUARD_PREFIX@_LIMITS_H -/* For HP-UX 11.31. */ -#if defined LONG_LONG_MIN && !defined LLONG_MIN -# define LLONG_MIN LONG_LONG_MIN +#ifndef LLONG_MIN +# if defined LONG_LONG_MIN /* HP-UX 11.31 */ +# define LLONG_MIN LONG_LONG_MIN +# elif defined LONGLONG_MIN /* IRIX 6.5 */ +# define LLONG_MIN LONGLONG_MIN +# elif defined __GNUC__ +# define LLONG_MIN (- __LONG_LONG_MAX__ - 1LL) +# endif #endif -#if defined LONG_LONG_MAX && !defined LLONG_MAX -# define LLONG_MAX LONG_LONG_MAX +#ifndef LLONG_MAX +# if defined LONG_LONG_MAX /* HP-UX 11.31 */ +# define LLONG_MAX LONG_LONG_MAX +# elif defined LONGLONG_MAX /* IRIX 6.5 */ +# define LLONG_MAX LONGLONG_MAX +# elif defined __GNUC__ +# define LLONG_MAX __LONG_LONG_MAX__ +# endif #endif -#if defined ULONG_LONG_MAX && !defined ULLONG_MAX -# define ULLONG_MAX ULONG_LONG_MAX +#ifndef ULLONG_MAX +# if defined ULONG_LONG_MAX /* HP-UX 11.31 */ +# define ULLONG_MAX ULONG_LONG_MAX +# elif defined ULONGLONG_MAX /* IRIX 6.5 */ +# define ULLONG_MAX ULONGLONG_MAX +# elif defined __GNUC__ +# define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1ULL) +# endif #endif /* The number of usable bits in an unsigned or signed integer type @@ -53,6 +70,19 @@ #define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n)) #define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1)) +#ifndef WORD_BIT +/* Assume 'int' is 32 bits wide. */ +# define WORD_BIT 32 +#endif +#ifndef LONG_BIT +/* Assume 'long' is 32 or 64 bits wide. */ +# if LONG_MAX == INT_MAX +# define LONG_BIT 32 +# else +# define LONG_BIT 64 +# endif +#endif + /* Macros specified by ISO/IEC TS 18661-1:2014. */ #if (! defined ULLONG_WIDTH \ diff --git a/gnu/link.c b/gnu/link.c index 70ad9ffa5048ba3ad81e1e195311d6c18f732359..2074b62b5c7d1a29a83c8618c7b496ec50446c38 100644 --- a/gnu/link.c +++ b/gnu/link.c @@ -1,6 +1,6 @@ /* Emulate link on platforms that lack it, namely native Windows platforms. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 @@ -25,11 +25,15 @@ #include #if !HAVE_LINK -# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# if defined _WIN32 && ! defined __CYGWIN__ # define WIN32_LEAN_AND_MEAN # include +/* Avoid warnings from gcc -Wcast-function-type. */ +# define GetProcAddress \ + (void *) GetProcAddress + /* CreateHardLink was introduced only in Windows 2000. */ typedef BOOL (WINAPI * CreateHardLinkFuncType) (LPCTSTR lpFileName, LPCTSTR lpExistingFileName, diff --git a/gnu/linkat.c b/gnu/linkat.c index 481717777f8d42aca89b49ad0324bde1cc5e448e..6a4f1a617059ab3589391f738a34064b536ac945 100644 --- a/gnu/linkat.c +++ b/gnu/linkat.c @@ -1,5 +1,5 @@ /* Create a hard link relative to open directories. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/localcharset.c b/gnu/localcharset.c index f16a1a1cb891ca4435f2254d9c34245075311540..38e27e6f3724ac0aa0395cc48a6117a2eb9569b5 100644 --- a/gnu/localcharset.c +++ b/gnu/localcharset.c @@ -1,6 +1,6 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2006, 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2000-2006, 2008-2019 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 @@ -22,7 +22,6 @@ /* Specification. */ #include "localcharset.h" -#include #include #include #include @@ -32,7 +31,7 @@ # define DARWIN7 /* Darwin 7 or newer, i.e. Mac OS X 10.3 or newer */ #endif -#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ +#if defined _WIN32 && !defined __CYGWIN__ # define WINDOWS_NATIVE # include #endif @@ -45,11 +44,10 @@ #endif #if !defined WINDOWS_NATIVE -# include # if HAVE_LANGINFO_CODESET # include # else -# if 0 /* see comment below */ +# if 0 /* see comment regarding use of setlocale(), below */ # include # endif # endif @@ -71,321 +69,613 @@ # include #endif -#if ENABLE_RELOCATABLE -# include "relocatable.h" -#else -# define relocate(pathname) (pathname) -# define relocate2(pathname,allocatedp) (*(allocatedp) = NULL, (pathname)) -#endif - -/* Get LIBDIR. */ -#ifndef LIBDIR -# include "configmake.h" -#endif - -/* Define O_NOFOLLOW to 0 on platforms where it does not exist. */ -#ifndef O_NOFOLLOW -# define O_NOFOLLOW 0 -#endif - -#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ - /* Native Windows, Cygwin, OS/2, DOS */ -# define ISSLASH(C) ((C) == '/' || (C) == '\\') -#endif -#ifndef DIRECTORY_SEPARATOR -# define DIRECTORY_SEPARATOR '/' -#endif +#if HAVE_LANGINFO_CODESET || defined WINDOWS_NATIVE || defined OS2 -#ifndef ISSLASH -# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) -#endif +/* On these platforms, we use a mapping from non-canonical encoding name + to GNU canonical encoding name. */ -#if HAVE_DECL_GETC_UNLOCKED -# undef getc -# define getc getc_unlocked -#endif +/* With glibc-2.1 or newer, we don't need any canonicalization, + because glibc has iconv and both glibc and libiconv support all + GNU canonical names directly. */ +# if !((defined __GNU_LIBRARY__ && __GLIBC__ >= 2) || defined __UCLIBC__) -/* The following static variable is declared 'volatile' to avoid a - possible multithread problem in the function get_charset_aliases. If we - are running in a threaded environment, and if two threads initialize - 'charset_aliases' simultaneously, both will produce the same value, - and everything will be ok if the two assignments to 'charset_aliases' - are atomic. But I don't know what will happen if the two assignments mix. */ -#if __STDC__ != 1 -# define volatile /* empty */ -#endif -/* Pointer to the contents of the charset.alias file, if it has already been - read, else NULL. Its format is: - ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */ -static const char * volatile charset_aliases; - -/* Return a pointer to the contents of the charset.alias file. */ -static const char * -get_charset_aliases (void) +struct table_entry { - const char *cp; - - cp = charset_aliases; - if (cp == NULL) - { -#if !(defined DARWIN7 || defined VMS || defined WINDOWS_NATIVE || defined __CYGWIN__ || defined OS2) - char *malloc_dir = NULL; - const char *dir; - const char *base = "charset.alias"; - char *file_name; - - /* Make it possible to override the charset.alias location. This is - necessary for running the testsuite before "make install". */ - dir = getenv ("CHARSETALIASDIR"); - if (dir == NULL || dir[0] == '\0') - dir = relocate2 (LIBDIR, &malloc_dir); - - /* Concatenate dir and base into freshly allocated file_name. */ - { - size_t dir_len = strlen (dir); - size_t base_len = strlen (base); - int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1])); - file_name = (char *) malloc (dir_len + add_slash + base_len + 1); - if (file_name != NULL) - { - memcpy (file_name, dir, dir_len); - if (add_slash) - file_name[dir_len] = DIRECTORY_SEPARATOR; - memcpy (file_name + dir_len + add_slash, base, base_len + 1); - } - } - - free (malloc_dir); - - if (file_name == NULL) - /* Out of memory. Treat the file as empty. */ - cp = ""; - else - { - int fd; - - /* Open the file. Reject symbolic links on platforms that support - O_NOFOLLOW. This is a security feature. Without it, an attacker - could retrieve parts of the contents (namely, the tail of the - first line that starts with "* ") of an arbitrary file by placing - a symbolic link to that file under the name "charset.alias" in - some writable directory and defining the environment variable - CHARSETALIASDIR to point to that directory. */ - fd = open (file_name, - O_RDONLY | (HAVE_WORKING_O_NOFOLLOW ? O_NOFOLLOW : 0)); - if (fd < 0) - /* File not found. Treat it as empty. */ - cp = ""; - else - { - FILE *fp; - - fp = fdopen (fd, "r"); - if (fp == NULL) - { - /* Out of memory. Treat the file as empty. */ - close (fd); - cp = ""; - } - else - { - /* Parse the file's contents. */ - char *res_ptr = NULL; - size_t res_size = 0; - - for (;;) - { - int c; - char buf1[50+1]; - char buf2[50+1]; - size_t l1, l2; - char *old_res_ptr; - - c = getc (fp); - if (c == EOF) - break; - if (c == '\n' || c == ' ' || c == '\t') - continue; - if (c == '#') - { - /* Skip comment, to end of line. */ - do - c = getc (fp); - while (!(c == EOF || c == '\n')); - if (c == EOF) - break; - continue; - } - ungetc (c, fp); - if (fscanf (fp, "%50s %50s", buf1, buf2) < 2) - break; - l1 = strlen (buf1); - l2 = strlen (buf2); - old_res_ptr = res_ptr; - if (res_size == 0) - { - res_size = l1 + 1 + l2 + 1; - res_ptr = (char *) malloc (res_size + 1); - } - else - { - res_size += l1 + 1 + l2 + 1; - res_ptr = (char *) realloc (res_ptr, res_size + 1); - } - if (res_ptr == NULL) - { - /* Out of memory. */ - res_size = 0; - free (old_res_ptr); - break; - } - strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1); - strcpy (res_ptr + res_size - (l2 + 1), buf2); - } - fclose (fp); - if (res_size == 0) - cp = ""; - else - { - *(res_ptr + res_size) = '\0'; - cp = res_ptr; - } - } - } + const char alias[11+1]; + const char canonical[11+1]; +}; + +/* Table of platform-dependent mappings, sorted in ascending order. */ +static const struct table_entry alias_table[] = + { +# if defined __FreeBSD__ /* FreeBSD */ + /*{ "ARMSCII-8", "ARMSCII-8" },*/ + { "Big5", "BIG5" }, + { "C", "ASCII" }, + /*{ "CP1131", "CP1131" },*/ + /*{ "CP1251", "CP1251" },*/ + /*{ "CP866", "CP866" },*/ + /*{ "GB18030", "GB18030" },*/ + /*{ "GB2312", "GB2312" },*/ + /*{ "GBK", "GBK" },*/ + /*{ "ISCII-DEV", "?" },*/ + { "ISO8859-1", "ISO-8859-1" }, + { "ISO8859-13", "ISO-8859-13" }, + { "ISO8859-15", "ISO-8859-15" }, + { "ISO8859-2", "ISO-8859-2" }, + { "ISO8859-5", "ISO-8859-5" }, + { "ISO8859-7", "ISO-8859-7" }, + { "ISO8859-9", "ISO-8859-9" }, + /*{ "KOI8-R", "KOI8-R" },*/ + /*{ "KOI8-U", "KOI8-U" },*/ + { "SJIS", "SHIFT_JIS" }, + { "US-ASCII", "ASCII" }, + { "eucCN", "GB2312" }, + { "eucJP", "EUC-JP" }, + { "eucKR", "EUC-KR" } +# define alias_table_defined +# endif +# if defined __NetBSD__ /* NetBSD */ + { "646", "ASCII" }, + /*{ "ARMSCII-8", "ARMSCII-8" },*/ + /*{ "BIG5", "BIG5" },*/ + { "Big5-HKSCS", "BIG5-HKSCS" }, + /*{ "CP1251", "CP1251" },*/ + /*{ "CP866", "CP866" },*/ + /*{ "GB18030", "GB18030" },*/ + /*{ "GB2312", "GB2312" },*/ + { "ISO8859-1", "ISO-8859-1" }, + { "ISO8859-13", "ISO-8859-13" }, + { "ISO8859-15", "ISO-8859-15" }, + { "ISO8859-2", "ISO-8859-2" }, + { "ISO8859-4", "ISO-8859-4" }, + { "ISO8859-5", "ISO-8859-5" }, + { "ISO8859-7", "ISO-8859-7" }, + /*{ "KOI8-R", "KOI8-R" },*/ + /*{ "KOI8-U", "KOI8-U" },*/ + /*{ "PT154", "PT154" },*/ + { "SJIS", "SHIFT_JIS" }, + { "eucCN", "GB2312" }, + { "eucJP", "EUC-JP" }, + { "eucKR", "EUC-KR" }, + { "eucTW", "EUC-TW" } +# define alias_table_defined +# endif +# if defined __OpenBSD__ /* OpenBSD */ + { "646", "ASCII" }, + { "ISO8859-1", "ISO-8859-1" }, + { "ISO8859-13", "ISO-8859-13" }, + { "ISO8859-15", "ISO-8859-15" }, + { "ISO8859-2", "ISO-8859-2" }, + { "ISO8859-4", "ISO-8859-4" }, + { "ISO8859-5", "ISO-8859-5" }, + { "ISO8859-7", "ISO-8859-7" } +# define alias_table_defined +# endif +# if defined __APPLE__ && defined __MACH__ /* Mac OS X */ + /* Darwin 7.5 has nl_langinfo(CODESET), but sometimes its value is + useless: + - It returns the empty string when LANG is set to a locale of the + form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8 + LC_CTYPE file. + - The environment variables LANG, LC_CTYPE, LC_ALL are not set by + the system; nl_langinfo(CODESET) returns "US-ASCII" in this case. + - The documentation says: + "... all code that calls BSD system routines should ensure + that the const *char parameters of these routines are in UTF-8 + encoding. All BSD system functions expect their string + parameters to be in UTF-8 encoding and nothing else." + It also says + "An additional caveat is that string parameters for files, + paths, and other file-system entities must be in canonical + UTF-8. In a canonical UTF-8 Unicode string, all decomposable + characters are decomposed ..." + but this is not true: You can pass non-decomposed UTF-8 strings + to file system functions, and it is the OS which will convert + them to decomposed UTF-8 before accessing the file system. + - The Apple Terminal application displays UTF-8 by default. + - However, other applications are free to use different encodings: + - xterm uses ISO-8859-1 by default. + - TextEdit uses MacRoman by default. + We prefer UTF-8 over decomposed UTF-8-MAC because one should + minimize the use of decomposed Unicode. Unfortunately, through the + Darwin file system, decomposed UTF-8 strings are leaked into user + space nevertheless. + Then there are also the locales with encodings other than US-ASCII + and UTF-8. These locales can be occasionally useful to users (e.g. + when grepping through ISO-8859-1 encoded text files), when all their + file names are in US-ASCII. + */ + { "ARMSCII-8", "ARMSCII-8" }, + { "Big5", "BIG5" }, + { "Big5HKSCS", "BIG5-HKSCS" }, + { "CP1131", "CP1131" }, + { "CP1251", "CP1251" }, + { "CP866", "CP866" }, + { "CP949", "CP949" }, + { "GB18030", "GB18030" }, + { "GB2312", "GB2312" }, + { "GBK", "GBK" }, + /*{ "ISCII-DEV", "?" },*/ + { "ISO8859-1", "ISO-8859-1" }, + { "ISO8859-13", "ISO-8859-13" }, + { "ISO8859-15", "ISO-8859-15" }, + { "ISO8859-2", "ISO-8859-2" }, + { "ISO8859-4", "ISO-8859-4" }, + { "ISO8859-5", "ISO-8859-5" }, + { "ISO8859-7", "ISO-8859-7" }, + { "ISO8859-9", "ISO-8859-9" }, + { "KOI8-R", "KOI8-R" }, + { "KOI8-U", "KOI8-U" }, + { "PT154", "PT154" }, + { "SJIS", "SHIFT_JIS" }, + { "eucCN", "GB2312" }, + { "eucJP", "EUC-JP" }, + { "eucKR", "EUC-KR" } +# define alias_table_defined +# endif +# if defined _AIX /* AIX */ + /*{ "GBK", "GBK" },*/ + { "IBM-1046", "CP1046" }, + { "IBM-1124", "CP1124" }, + { "IBM-1129", "CP1129" }, + { "IBM-1252", "CP1252" }, + { "IBM-850", "CP850" }, + { "IBM-856", "CP856" }, + { "IBM-921", "ISO-8859-13" }, + { "IBM-922", "CP922" }, + { "IBM-932", "CP932" }, + { "IBM-943", "CP943" }, + { "IBM-eucCN", "GB2312" }, + { "IBM-eucJP", "EUC-JP" }, + { "IBM-eucKR", "EUC-KR" }, + { "IBM-eucTW", "EUC-TW" }, + { "ISO8859-1", "ISO-8859-1" }, + { "ISO8859-15", "ISO-8859-15" }, + { "ISO8859-2", "ISO-8859-2" }, + { "ISO8859-5", "ISO-8859-5" }, + { "ISO8859-6", "ISO-8859-6" }, + { "ISO8859-7", "ISO-8859-7" }, + { "ISO8859-8", "ISO-8859-8" }, + { "ISO8859-9", "ISO-8859-9" }, + { "TIS-620", "TIS-620" }, + /*{ "UTF-8", "UTF-8" },*/ + { "big5", "BIG5" } +# define alias_table_defined +# endif +# if defined __hpux /* HP-UX */ + { "SJIS", "SHIFT_JIS" }, + { "arabic8", "HP-ARABIC8" }, + { "big5", "BIG5" }, + { "cp1251", "CP1251" }, + { "eucJP", "EUC-JP" }, + { "eucKR", "EUC-KR" }, + { "eucTW", "EUC-TW" }, + { "gb18030", "GB18030" }, + { "greek8", "HP-GREEK8" }, + { "hebrew8", "HP-HEBREW8" }, + { "hkbig5", "BIG5-HKSCS" }, + { "hp15CN", "GB2312" }, + { "iso88591", "ISO-8859-1" }, + { "iso885913", "ISO-8859-13" }, + { "iso885915", "ISO-8859-15" }, + { "iso88592", "ISO-8859-2" }, + { "iso88594", "ISO-8859-4" }, + { "iso88595", "ISO-8859-5" }, + { "iso88596", "ISO-8859-6" }, + { "iso88597", "ISO-8859-7" }, + { "iso88598", "ISO-8859-8" }, + { "iso88599", "ISO-8859-9" }, + { "kana8", "HP-KANA8" }, + { "koi8r", "KOI8-R" }, + { "roman8", "HP-ROMAN8" }, + { "tis620", "TIS-620" }, + { "turkish8", "HP-TURKISH8" }, + { "utf8", "UTF-8" } +# define alias_table_defined +# endif +# if defined __sgi /* IRIX */ + { "ISO8859-1", "ISO-8859-1" }, + { "ISO8859-15", "ISO-8859-15" }, + { "ISO8859-2", "ISO-8859-2" }, + { "ISO8859-5", "ISO-8859-5" }, + { "ISO8859-7", "ISO-8859-7" }, + { "ISO8859-9", "ISO-8859-9" }, + { "eucCN", "GB2312" }, + { "eucJP", "EUC-JP" }, + { "eucKR", "EUC-KR" }, + { "eucTW", "EUC-TW" } +# define alias_table_defined +# endif +# if defined __osf__ /* OSF/1 */ + /*{ "GBK", "GBK" },*/ + { "ISO8859-1", "ISO-8859-1" }, + { "ISO8859-15", "ISO-8859-15" }, + { "ISO8859-2", "ISO-8859-2" }, + { "ISO8859-4", "ISO-8859-4" }, + { "ISO8859-5", "ISO-8859-5" }, + { "ISO8859-7", "ISO-8859-7" }, + { "ISO8859-8", "ISO-8859-8" }, + { "ISO8859-9", "ISO-8859-9" }, + { "KSC5601", "CP949" }, + { "SJIS", "SHIFT_JIS" }, + { "TACTIS", "TIS-620" }, + /*{ "UTF-8", "UTF-8" },*/ + { "big5", "BIG5" }, + { "cp850", "CP850" }, + { "dechanyu", "DEC-HANYU" }, + { "dechanzi", "GB2312" }, + { "deckanji", "DEC-KANJI" }, + { "deckorean", "EUC-KR" }, + { "eucJP", "EUC-JP" }, + { "eucKR", "EUC-KR" }, + { "eucTW", "EUC-TW" }, + { "sdeckanji", "EUC-JP" } +# define alias_table_defined +# endif +# if defined __sun /* Solaris */ + { "5601", "EUC-KR" }, + { "646", "ASCII" }, + /*{ "BIG5", "BIG5" },*/ + { "Big5-HKSCS", "BIG5-HKSCS" }, + { "GB18030", "GB18030" }, + /*{ "GBK", "GBK" },*/ + { "ISO8859-1", "ISO-8859-1" }, + { "ISO8859-11", "TIS-620" }, + { "ISO8859-13", "ISO-8859-13" }, + { "ISO8859-15", "ISO-8859-15" }, + { "ISO8859-2", "ISO-8859-2" }, + { "ISO8859-3", "ISO-8859-3" }, + { "ISO8859-4", "ISO-8859-4" }, + { "ISO8859-5", "ISO-8859-5" }, + { "ISO8859-6", "ISO-8859-6" }, + { "ISO8859-7", "ISO-8859-7" }, + { "ISO8859-8", "ISO-8859-8" }, + { "ISO8859-9", "ISO-8859-9" }, + { "PCK", "SHIFT_JIS" }, + { "TIS620.2533", "TIS-620" }, + /*{ "UTF-8", "UTF-8" },*/ + { "ansi-1251", "CP1251" }, + { "cns11643", "EUC-TW" }, + { "eucJP", "EUC-JP" }, + { "gb2312", "GB2312" }, + { "koi8-r", "KOI8-R" } +# define alias_table_defined +# endif +# if defined __minix /* Minix */ + { "646", "ASCII" } +# define alias_table_defined +# endif +# if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Windows */ + { "CP1361", "JOHAB" }, + { "CP20127", "ASCII" }, + { "CP20866", "KOI8-R" }, + { "CP20936", "GB2312" }, + { "CP21866", "KOI8-RU" }, + { "CP28591", "ISO-8859-1" }, + { "CP28592", "ISO-8859-2" }, + { "CP28593", "ISO-8859-3" }, + { "CP28594", "ISO-8859-4" }, + { "CP28595", "ISO-8859-5" }, + { "CP28596", "ISO-8859-6" }, + { "CP28597", "ISO-8859-7" }, + { "CP28598", "ISO-8859-8" }, + { "CP28599", "ISO-8859-9" }, + { "CP28605", "ISO-8859-15" }, + { "CP38598", "ISO-8859-8" }, + { "CP51932", "EUC-JP" }, + { "CP51936", "GB2312" }, + { "CP51949", "EUC-KR" }, + { "CP51950", "EUC-TW" }, + { "CP54936", "GB18030" }, + { "CP65001", "UTF-8" }, + { "CP936", "GBK" } +# define alias_table_defined +# endif +# if defined OS2 /* OS/2 */ + /* The list of encodings is taken from "List of OS/2 Codepages" + by Alex Taylor: + . + See also "IBM Globalization - Code page identifiers": + . */ + { "CP1089", "ISO-8859-6" }, + { "CP1208", "UTF-8" }, + { "CP1381", "GB2312" }, + { "CP1386", "GBK" }, + { "CP3372", "EUC-JP" }, + { "CP813", "ISO-8859-7" }, + { "CP819", "ISO-8859-1" }, + { "CP878", "KOI8-R" }, + { "CP912", "ISO-8859-2" }, + { "CP913", "ISO-8859-3" }, + { "CP914", "ISO-8859-4" }, + { "CP915", "ISO-8859-5" }, + { "CP916", "ISO-8859-8" }, + { "CP920", "ISO-8859-9" }, + { "CP921", "ISO-8859-13" }, + { "CP923", "ISO-8859-15" }, + { "CP954", "EUC-JP" }, + { "CP964", "EUC-TW" }, + { "CP970", "EUC-KR" } +# define alias_table_defined +# endif +# if defined VMS /* OpenVMS */ + /* The list of encodings is taken from the OpenVMS 7.3-1 documentation + "Compaq C Run-Time Library Reference Manual for OpenVMS systems" + section 10.7 "Handling Different Character Sets". */ + { "DECHANYU", "DEC-HANYU" }, + { "DECHANZI", "GB2312" }, + { "DECKANJI", "DEC-KANJI" }, + { "DECKOREAN", "EUC-KR" }, + { "ISO8859-1", "ISO-8859-1" }, + { "ISO8859-2", "ISO-8859-2" }, + { "ISO8859-5", "ISO-8859-5" }, + { "ISO8859-7", "ISO-8859-7" }, + { "ISO8859-8", "ISO-8859-8" }, + { "ISO8859-9", "ISO-8859-9" }, + { "SDECKANJI", "EUC-JP" }, + { "SJIS", "SHIFT_JIS" }, + { "eucJP", "EUC-JP" }, + { "eucTW", "EUC-TW" } +# define alias_table_defined +# endif +# ifndef alias_table_defined + /* Just a dummy entry, to avoid a C syntax error. */ + { "", "" } +# endif + }; - free (file_name); - } +# endif #else -# if defined DARWIN7 - /* To avoid the trouble of installing a file that is shared by many - GNU packages -- many packaging systems have problems with this --, - simply inline the aliases here. */ - cp = "ISO8859-1" "\0" "ISO-8859-1" "\0" - "ISO8859-2" "\0" "ISO-8859-2" "\0" - "ISO8859-4" "\0" "ISO-8859-4" "\0" - "ISO8859-5" "\0" "ISO-8859-5" "\0" - "ISO8859-7" "\0" "ISO-8859-7" "\0" - "ISO8859-9" "\0" "ISO-8859-9" "\0" - "ISO8859-13" "\0" "ISO-8859-13" "\0" - "ISO8859-15" "\0" "ISO-8859-15" "\0" - "KOI8-R" "\0" "KOI8-R" "\0" - "KOI8-U" "\0" "KOI8-U" "\0" - "CP866" "\0" "CP866" "\0" - "CP949" "\0" "CP949" "\0" - "CP1131" "\0" "CP1131" "\0" - "CP1251" "\0" "CP1251" "\0" - "eucCN" "\0" "GB2312" "\0" - "GB2312" "\0" "GB2312" "\0" - "eucJP" "\0" "EUC-JP" "\0" - "eucKR" "\0" "EUC-KR" "\0" - "Big5" "\0" "BIG5" "\0" - "Big5HKSCS" "\0" "BIG5-HKSCS" "\0" - "GBK" "\0" "GBK" "\0" - "GB18030" "\0" "GB18030" "\0" - "SJIS" "\0" "SHIFT_JIS" "\0" - "ARMSCII-8" "\0" "ARMSCII-8" "\0" - "PT154" "\0" "PT154" "\0" - /*"ISCII-DEV" "\0" "?" "\0"*/ - "*" "\0" "UTF-8" "\0"; -# endif +/* On these platforms, we use a mapping from locale name to GNU canonical + encoding name. */ -# if defined VMS - /* To avoid the troubles of an extra file charset.alias_vms in the - sources of many GNU packages, simply inline the aliases here. */ - /* The list of encodings is taken from the OpenVMS 7.3-1 documentation - "Compaq C Run-Time Library Reference Manual for OpenVMS systems" - section 10.7 "Handling Different Character Sets". */ - cp = "ISO8859-1" "\0" "ISO-8859-1" "\0" - "ISO8859-2" "\0" "ISO-8859-2" "\0" - "ISO8859-5" "\0" "ISO-8859-5" "\0" - "ISO8859-7" "\0" "ISO-8859-7" "\0" - "ISO8859-8" "\0" "ISO-8859-8" "\0" - "ISO8859-9" "\0" "ISO-8859-9" "\0" - /* Japanese */ - "eucJP" "\0" "EUC-JP" "\0" - "SJIS" "\0" "SHIFT_JIS" "\0" - "DECKANJI" "\0" "DEC-KANJI" "\0" - "SDECKANJI" "\0" "EUC-JP" "\0" - /* Chinese */ - "eucTW" "\0" "EUC-TW" "\0" - "DECHANYU" "\0" "DEC-HANYU" "\0" - "DECHANZI" "\0" "GB2312" "\0" - /* Korean */ - "DECKOREAN" "\0" "EUC-KR" "\0"; +struct table_entry +{ + const char locale[17+1]; + const char canonical[11+1]; +}; + +/* Table of platform-dependent mappings, sorted in ascending order. */ +static const struct table_entry locale_table[] = + { +# if defined __FreeBSD__ /* FreeBSD 4.2 */ + { "cs_CZ.ISO_8859-2", "ISO-8859-2" }, + { "da_DK.DIS_8859-15", "ISO-8859-15" }, + { "da_DK.ISO_8859-1", "ISO-8859-1" }, + { "de_AT.DIS_8859-15", "ISO-8859-15" }, + { "de_AT.ISO_8859-1", "ISO-8859-1" }, + { "de_CH.DIS_8859-15", "ISO-8859-15" }, + { "de_CH.ISO_8859-1", "ISO-8859-1" }, + { "de_DE.DIS_8859-15", "ISO-8859-15" }, + { "de_DE.ISO_8859-1", "ISO-8859-1" }, + { "en_AU.DIS_8859-15", "ISO-8859-15" }, + { "en_AU.ISO_8859-1", "ISO-8859-1" }, + { "en_CA.DIS_8859-15", "ISO-8859-15" }, + { "en_CA.ISO_8859-1", "ISO-8859-1" }, + { "en_GB.DIS_8859-15", "ISO-8859-15" }, + { "en_GB.ISO_8859-1", "ISO-8859-1" }, + { "en_US.DIS_8859-15", "ISO-8859-15" }, + { "en_US.ISO_8859-1", "ISO-8859-1" }, + { "es_ES.DIS_8859-15", "ISO-8859-15" }, + { "es_ES.ISO_8859-1", "ISO-8859-1" }, + { "fi_FI.DIS_8859-15", "ISO-8859-15" }, + { "fi_FI.ISO_8859-1", "ISO-8859-1" }, + { "fr_BE.DIS_8859-15", "ISO-8859-15" }, + { "fr_BE.ISO_8859-1", "ISO-8859-1" }, + { "fr_CA.DIS_8859-15", "ISO-8859-15" }, + { "fr_CA.ISO_8859-1", "ISO-8859-1" }, + { "fr_CH.DIS_8859-15", "ISO-8859-15" }, + { "fr_CH.ISO_8859-1", "ISO-8859-1" }, + { "fr_FR.DIS_8859-15", "ISO-8859-15" }, + { "fr_FR.ISO_8859-1", "ISO-8859-1" }, + { "hr_HR.ISO_8859-2", "ISO-8859-2" }, + { "hu_HU.ISO_8859-2", "ISO-8859-2" }, + { "is_IS.DIS_8859-15", "ISO-8859-15" }, + { "is_IS.ISO_8859-1", "ISO-8859-1" }, + { "it_CH.DIS_8859-15", "ISO-8859-15" }, + { "it_CH.ISO_8859-1", "ISO-8859-1" }, + { "it_IT.DIS_8859-15", "ISO-8859-15" }, + { "it_IT.ISO_8859-1", "ISO-8859-1" }, + { "ja_JP.EUC", "EUC-JP" }, + { "ja_JP.SJIS", "SHIFT_JIS" }, + { "ja_JP.Shift_JIS", "SHIFT_JIS" }, + { "ko_KR.EUC", "EUC-KR" }, + { "la_LN.ASCII", "ASCII" }, + { "la_LN.DIS_8859-15", "ISO-8859-15" }, + { "la_LN.ISO_8859-1", "ISO-8859-1" }, + { "la_LN.ISO_8859-2", "ISO-8859-2" }, + { "la_LN.ISO_8859-4", "ISO-8859-4" }, + { "lt_LN.ASCII", "ASCII" }, + { "lt_LN.DIS_8859-15", "ISO-8859-15" }, + { "lt_LN.ISO_8859-1", "ISO-8859-1" }, + { "lt_LN.ISO_8859-2", "ISO-8859-2" }, + { "lt_LT.ISO_8859-4", "ISO-8859-4" }, + { "nl_BE.DIS_8859-15", "ISO-8859-15" }, + { "nl_BE.ISO_8859-1", "ISO-8859-1" }, + { "nl_NL.DIS_8859-15", "ISO-8859-15" }, + { "nl_NL.ISO_8859-1", "ISO-8859-1" }, + { "no_NO.DIS_8859-15", "ISO-8859-15" }, + { "no_NO.ISO_8859-1", "ISO-8859-1" }, + { "pl_PL.ISO_8859-2", "ISO-8859-2" }, + { "pt_PT.DIS_8859-15", "ISO-8859-15" }, + { "pt_PT.ISO_8859-1", "ISO-8859-1" }, + { "ru_RU.CP866", "CP866" }, + { "ru_RU.ISO_8859-5", "ISO-8859-5" }, + { "ru_RU.KOI8-R", "KOI8-R" }, + { "ru_SU.CP866", "CP866" }, + { "ru_SU.ISO_8859-5", "ISO-8859-5" }, + { "ru_SU.KOI8-R", "KOI8-R" }, + { "sl_SI.ISO_8859-2", "ISO-8859-2" }, + { "sv_SE.DIS_8859-15", "ISO-8859-15" }, + { "sv_SE.ISO_8859-1", "ISO-8859-1" }, + { "uk_UA.KOI8-U", "KOI8-U" }, + { "zh_CN.EUC", "GB2312" }, + { "zh_TW.BIG5", "BIG5" }, + { "zh_TW.Big5", "BIG5" } +# define locale_table_defined # endif - -# if defined WINDOWS_NATIVE || defined __CYGWIN__ - /* To avoid the troubles of installing a separate file in the same - directory as the DLL and of retrieving the DLL's directory at - runtime, simply inline the aliases here. */ - - cp = "CP936" "\0" "GBK" "\0" - "CP1361" "\0" "JOHAB" "\0" - "CP20127" "\0" "ASCII" "\0" - "CP20866" "\0" "KOI8-R" "\0" - "CP20936" "\0" "GB2312" "\0" - "CP21866" "\0" "KOI8-RU" "\0" - "CP28591" "\0" "ISO-8859-1" "\0" - "CP28592" "\0" "ISO-8859-2" "\0" - "CP28593" "\0" "ISO-8859-3" "\0" - "CP28594" "\0" "ISO-8859-4" "\0" - "CP28595" "\0" "ISO-8859-5" "\0" - "CP28596" "\0" "ISO-8859-6" "\0" - "CP28597" "\0" "ISO-8859-7" "\0" - "CP28598" "\0" "ISO-8859-8" "\0" - "CP28599" "\0" "ISO-8859-9" "\0" - "CP28605" "\0" "ISO-8859-15" "\0" - "CP38598" "\0" "ISO-8859-8" "\0" - "CP51932" "\0" "EUC-JP" "\0" - "CP51936" "\0" "GB2312" "\0" - "CP51949" "\0" "EUC-KR" "\0" - "CP51950" "\0" "EUC-TW" "\0" - "CP54936" "\0" "GB18030" "\0" - "CP65001" "\0" "UTF-8" "\0"; +# if defined __DJGPP__ /* DOS / DJGPP 2.03 */ + /* The encodings given here may not all be correct. + If you find that the encoding given for your language and + country is not the one your DOS machine actually uses, just + correct it in this file, and send a mail to + Juan Manuel Guerrero + and . */ + { "C", "ASCII" }, + { "ar", "CP864" }, + { "ar_AE", "CP864" }, + { "ar_DZ", "CP864" }, + { "ar_EG", "CP864" }, + { "ar_IQ", "CP864" }, + { "ar_IR", "CP864" }, + { "ar_JO", "CP864" }, + { "ar_KW", "CP864" }, + { "ar_MA", "CP864" }, + { "ar_OM", "CP864" }, + { "ar_QA", "CP864" }, + { "ar_SA", "CP864" }, + { "ar_SY", "CP864" }, + { "be", "CP866" }, + { "be_BE", "CP866" }, + { "bg", "CP866" }, /* not CP855 ?? */ + { "bg_BG", "CP866" }, /* not CP855 ?? */ + { "ca", "CP850" }, + { "ca_ES", "CP850" }, + { "cs", "CP852" }, + { "cs_CZ", "CP852" }, + { "da", "CP865" }, /* not CP850 ?? */ + { "da_DK", "CP865" }, /* not CP850 ?? */ + { "de", "CP850" }, + { "de_AT", "CP850" }, + { "de_CH", "CP850" }, + { "de_DE", "CP850" }, + { "el", "CP869" }, + { "el_GR", "CP869" }, + { "en", "CP850" }, + { "en_AU", "CP850" }, /* not CP437 ?? */ + { "en_CA", "CP850" }, + { "en_GB", "CP850" }, + { "en_NZ", "CP437" }, + { "en_US", "CP437" }, + { "en_ZA", "CP850" }, /* not CP437 ?? */ + { "eo", "CP850" }, + { "eo_EO", "CP850" }, + { "es", "CP850" }, + { "es_AR", "CP850" }, + { "es_BO", "CP850" }, + { "es_CL", "CP850" }, + { "es_CO", "CP850" }, + { "es_CR", "CP850" }, + { "es_CU", "CP850" }, + { "es_DO", "CP850" }, + { "es_EC", "CP850" }, + { "es_ES", "CP850" }, + { "es_GT", "CP850" }, + { "es_HN", "CP850" }, + { "es_MX", "CP850" }, + { "es_NI", "CP850" }, + { "es_PA", "CP850" }, + { "es_PE", "CP850" }, + { "es_PY", "CP850" }, + { "es_SV", "CP850" }, + { "es_UY", "CP850" }, + { "es_VE", "CP850" }, + { "et", "CP850" }, + { "et_EE", "CP850" }, + { "eu", "CP850" }, + { "eu_ES", "CP850" }, + { "fi", "CP850" }, + { "fi_FI", "CP850" }, + { "fr", "CP850" }, + { "fr_BE", "CP850" }, + { "fr_CA", "CP850" }, + { "fr_CH", "CP850" }, + { "fr_FR", "CP850" }, + { "ga", "CP850" }, + { "ga_IE", "CP850" }, + { "gd", "CP850" }, + { "gd_GB", "CP850" }, + { "gl", "CP850" }, + { "gl_ES", "CP850" }, + { "he", "CP862" }, + { "he_IL", "CP862" }, + { "hr", "CP852" }, + { "hr_HR", "CP852" }, + { "hu", "CP852" }, + { "hu_HU", "CP852" }, + { "id", "CP850" }, /* not CP437 ?? */ + { "id_ID", "CP850" }, /* not CP437 ?? */ + { "is", "CP861" }, /* not CP850 ?? */ + { "is_IS", "CP861" }, /* not CP850 ?? */ + { "it", "CP850" }, + { "it_CH", "CP850" }, + { "it_IT", "CP850" }, + { "ja", "CP932" }, + { "ja_JP", "CP932" }, + { "kr", "CP949" }, /* not CP934 ?? */ + { "kr_KR", "CP949" }, /* not CP934 ?? */ + { "lt", "CP775" }, + { "lt_LT", "CP775" }, + { "lv", "CP775" }, + { "lv_LV", "CP775" }, + { "mk", "CP866" }, /* not CP855 ?? */ + { "mk_MK", "CP866" }, /* not CP855 ?? */ + { "mt", "CP850" }, + { "mt_MT", "CP850" }, + { "nb", "CP865" }, /* not CP850 ?? */ + { "nb_NO", "CP865" }, /* not CP850 ?? */ + { "nl", "CP850" }, + { "nl_BE", "CP850" }, + { "nl_NL", "CP850" }, + { "nn", "CP865" }, /* not CP850 ?? */ + { "nn_NO", "CP865" }, /* not CP850 ?? */ + { "no", "CP865" }, /* not CP850 ?? */ + { "no_NO", "CP865" }, /* not CP850 ?? */ + { "pl", "CP852" }, + { "pl_PL", "CP852" }, + { "pt", "CP850" }, + { "pt_BR", "CP850" }, + { "pt_PT", "CP850" }, + { "ro", "CP852" }, + { "ro_RO", "CP852" }, + { "ru", "CP866" }, + { "ru_RU", "CP866" }, + { "sk", "CP852" }, + { "sk_SK", "CP852" }, + { "sl", "CP852" }, + { "sl_SI", "CP852" }, + { "sq", "CP852" }, + { "sq_AL", "CP852" }, + { "sr", "CP852" }, /* CP852 or CP866 or CP855 ?? */ + { "sr_CS", "CP852" }, /* CP852 or CP866 or CP855 ?? */ + { "sr_YU", "CP852" }, /* CP852 or CP866 or CP855 ?? */ + { "sv", "CP850" }, + { "sv_SE", "CP850" }, + { "th", "CP874" }, + { "th_TH", "CP874" }, + { "tr", "CP857" }, + { "tr_TR", "CP857" }, + { "uk", "CP1125" }, + { "uk_UA", "CP1125" }, + { "zh_CN", "GBK" }, + { "zh_TW", "CP950" } /* not CP938 ?? */ +# define locale_table_defined # endif -# if defined OS2 - /* To avoid the troubles of installing a separate file in the same - directory as the DLL and of retrieving the DLL's directory at - runtime, simply inline the aliases here. */ - - /* The list of encodings is taken from "List of OS/2 Codepages" - by Alex Taylor: - . - See also "IBM Globalization - Code page identifiers": - . */ - cp = "CP813" "\0" "ISO-8859-7" "\0" - "CP878" "\0" "KOI8-R" "\0" - "CP819" "\0" "ISO-8859-1" "\0" - "CP912" "\0" "ISO-8859-2" "\0" - "CP913" "\0" "ISO-8859-3" "\0" - "CP914" "\0" "ISO-8859-4" "\0" - "CP915" "\0" "ISO-8859-5" "\0" - "CP916" "\0" "ISO-8859-8" "\0" - "CP920" "\0" "ISO-8859-9" "\0" - "CP921" "\0" "ISO-8859-13" "\0" - "CP923" "\0" "ISO-8859-15" "\0" - "CP954" "\0" "EUC-JP" "\0" - "CP964" "\0" "EUC-TW" "\0" - "CP970" "\0" "EUC-KR" "\0" - "CP1089" "\0" "ISO-8859-6" "\0" - "CP1208" "\0" "UTF-8" "\0" - "CP1381" "\0" "GB2312" "\0" - "CP1386" "\0" "GBK" "\0" - "CP3372" "\0" "EUC-JP" "\0"; +# ifndef locale_table_defined + /* Just a dummy entry, to avoid a C syntax error. */ + { "", "" } # endif -#endif + }; - charset_aliases = cp; - } +#endif - return cp; -} /* Determine the current locale's character encoding, and canonicalize it - into one of the canonical names listed in config.charset. + into one of the canonical names listed in localcharset.h. The result must not be freed; it is statically allocated. If the canonical name cannot be determined, the result is a non-canonical name. */ @@ -397,9 +687,8 @@ const char * locale_charset (void) { const char *codeset; - const char *aliases; -#if !(defined WINDOWS_NATIVE || defined OS2) +#if HAVE_LANGINFO_CODESET || defined WINDOWS_NATIVE || defined OS2 # if HAVE_LANGINFO_CODESET @@ -462,37 +751,11 @@ locale_charset (void) } # endif -# else - - /* On old systems which lack it, use setlocale or getenv. */ - const char *locale = NULL; - - /* But most old systems don't have a complete set of locales. Some - (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't - use setlocale here; it would return "C" when it doesn't support the - locale name the user has set. */ -# if 0 - locale = setlocale (LC_CTYPE, NULL); -# endif - if (locale == NULL || locale[0] == '\0') - { - locale = getenv ("LC_ALL"); - if (locale == NULL || locale[0] == '\0') - { - locale = getenv ("LC_CTYPE"); - if (locale == NULL || locale[0] == '\0') - locale = getenv ("LANG"); - } - } - - /* On some old systems, one used to set locale = "iso8859_1". On others, - you set it to "language_COUNTRY.charset". In any case, we resolve it - through the charset.alias file. */ - codeset = locale; - -# endif + if (codeset == NULL) + /* The canonical name cannot be determined. */ + codeset = ""; -#elif defined WINDOWS_NATIVE +# elif defined WINDOWS_NATIVE static char buf[2 + 10 + 1]; @@ -526,7 +789,7 @@ locale_charset (void) } codeset = buf; -#elif defined OS2 +# elif defined OS2 const char *locale; static char buf[2 + 10 + 1]; @@ -583,28 +846,144 @@ locale_charset (void) } } -#endif +# else - if (codeset == NULL) - /* The canonical name cannot be determined. */ - codeset = ""; +# error "Add code for other platforms here." - /* Resolve alias. */ - for (aliases = get_charset_aliases (); - *aliases != '\0'; - aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1) - if (strcmp (codeset, aliases) == 0 - || (aliases[0] == '*' && aliases[1] == '\0')) +# endif + + /* Resolve alias. */ + { +# ifdef alias_table_defined + /* On some platforms, UTF-8 locales are the most frequently used ones. + Speed up the common case and slow down the less common cases by + testing for this case first. */ +# if defined __OpenBSD__ || (defined __APPLE__ && defined __MACH__) || defined __sun || defined __CYGWIN__ + if (strcmp (codeset, "UTF-8") == 0) + goto done_table_lookup; + else +# endif { - codeset = aliases + strlen (aliases) + 1; - break; + const struct table_entry * const table = alias_table; + size_t const table_size = + sizeof (alias_table) / sizeof (struct table_entry); + /* The table is sorted. Perform a binary search. */ + size_t hi = table_size; + size_t lo = 0; + while (lo < hi) + { + /* Invariant: + for i < lo, strcmp (table[i].alias, codeset) < 0, + for i >= hi, strcmp (table[i].alias, codeset) > 0. */ + size_t mid = (hi + lo) >> 1; /* >= lo, < hi */ + int cmp = strcmp (table[mid].alias, codeset); + if (cmp < 0) + lo = mid + 1; + else if (cmp > 0) + hi = mid; + else + { + /* Found an i with + strcmp (table[i].alias, codeset) == 0. */ + codeset = table[mid].canonical; + goto done_table_lookup; + } + } } + if (0) + done_table_lookup: ; + else +# endif + { + /* Did not find it in the table. */ + /* On Mac OS X, all modern locales use the UTF-8 encoding. + BeOS and Haiku have a single locale, and it has UTF-8 encoding. */ +# if (defined __APPLE__ && defined __MACH__) || defined __BEOS__ || defined __HAIKU__ + codeset = "UTF-8"; +# else + /* Don't return an empty string. GNU libc and GNU libiconv interpret + the empty string as denoting "the locale's character encoding", + thus GNU libiconv would call this function a second time. */ + if (codeset[0] == '\0') + codeset = "ASCII"; +# endif + } + } - /* Don't return an empty string. GNU libc and GNU libiconv interpret - the empty string as denoting "the locale's character encoding", - thus GNU libiconv would call this function a second time. */ - if (codeset[0] == '\0') - codeset = "ASCII"; +#else + + /* On old systems which lack it, use setlocale or getenv. */ + const char *locale = NULL; + + /* But most old systems don't have a complete set of locales. Some + (like DJGPP) have only the C locale. Therefore we don't use setlocale + here; it would return "C" when it doesn't support the locale name the + user has set. */ +# if 0 + locale = setlocale (LC_CTYPE, NULL); +# endif + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_ALL"); + if (locale == NULL || locale[0] == '\0') + { + locale = getenv ("LC_CTYPE"); + if (locale == NULL || locale[0] == '\0') + locale = getenv ("LANG"); + if (locale == NULL) + locale = ""; + } + } + + /* Map locale name to canonical encoding name. */ + { +# ifdef locale_table_defined + const struct table_entry * const table = locale_table; + size_t const table_size = + sizeof (locale_table) / sizeof (struct table_entry); + /* The table is sorted. Perform a binary search. */ + size_t hi = table_size; + size_t lo = 0; + while (lo < hi) + { + /* Invariant: + for i < lo, strcmp (table[i].locale, locale) < 0, + for i >= hi, strcmp (table[i].locale, locale) > 0. */ + size_t mid = (hi + lo) >> 1; /* >= lo, < hi */ + int cmp = strcmp (table[mid].locale, locale); + if (cmp < 0) + lo = mid + 1; + else if (cmp > 0) + hi = mid; + else + { + /* Found an i with + strcmp (table[i].locale, locale) == 0. */ + codeset = table[mid].canonical; + goto done_table_lookup; + } + } + if (0) + done_table_lookup: ; + else +# endif + { + /* Did not find it in the table. */ + /* On Mac OS X, all modern locales use the UTF-8 encoding. + BeOS and Haiku have a single locale, and it has UTF-8 encoding. */ +# if (defined __APPLE__ && defined __MACH__) || defined __BEOS__ || defined __HAIKU__ + codeset = "UTF-8"; +# else + /* The canonical name cannot be determined. */ + /* Don't return an empty string. GNU libc and GNU libiconv interpret + the empty string as denoting "the locale's character encoding", + thus GNU libiconv would call this function a second time. */ + codeset = "ASCII"; +# endif + } + } + +#endif #ifdef DARWIN7 /* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8" diff --git a/gnu/localcharset.h b/gnu/localcharset.h index bca429b67054d29b15d18d826fd9b0910e34d5f9..7d0d7711dbe40776da92a9b6e501818116d5b38e 100644 --- a/gnu/localcharset.h +++ b/gnu/localcharset.h @@ -1,5 +1,5 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2003, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU CHARSET Library. This program is free software; you can redistribute it and/or modify @@ -25,12 +25,106 @@ extern "C" { /* Determine the current locale's character encoding, and canonicalize it - into one of the canonical names listed in config.charset. + into one of the canonical names listed below. The result must not be freed; it is statically allocated. If the canonical name cannot be determined, the result is a non-canonical name. */ extern const char * locale_charset (void); +/* About GNU canonical names for character encodings: + + Every canonical name must be supported by GNU libiconv. Support by GNU libc + is also desirable. + + The name is case insensitive. Usually an upper case MIME charset name is + preferred. + + The current list of these GNU canonical names is: + + name MIME? used by which systems + (darwin = Mac OS X, windows = native Windows) + + ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin minix cygwin + ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin + ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin + ISO-8859-3 Y glibc solaris cygwin + ISO-8859-4 Y hpux osf solaris freebsd netbsd openbsd darwin + ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin + ISO-8859-6 Y glibc aix hpux solaris cygwin + ISO-8859-7 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin + ISO-8859-8 Y glibc aix hpux osf solaris cygwin + ISO-8859-9 Y glibc aix hpux irix osf solaris freebsd darwin cygwin + ISO-8859-13 glibc hpux solaris freebsd netbsd openbsd darwin cygwin + ISO-8859-14 glibc cygwin + ISO-8859-15 glibc aix irix osf solaris freebsd netbsd openbsd darwin cygwin + KOI8-R Y glibc hpux solaris freebsd netbsd openbsd darwin + KOI8-U Y glibc freebsd netbsd openbsd darwin cygwin + KOI8-T glibc + CP437 dos + CP775 dos + CP850 aix osf dos + CP852 dos + CP855 dos + CP856 aix + CP857 dos + CP861 dos + CP862 dos + CP864 dos + CP865 dos + CP866 freebsd netbsd openbsd darwin dos + CP869 dos + CP874 windows dos + CP922 aix + CP932 aix cygwin windows dos + CP943 aix + CP949 osf darwin windows dos + CP950 windows dos + CP1046 aix + CP1124 aix + CP1125 dos + CP1129 aix + CP1131 freebsd darwin + CP1250 windows + CP1251 glibc hpux solaris freebsd netbsd openbsd darwin cygwin windows + CP1252 aix windows + CP1253 windows + CP1254 windows + CP1255 glibc windows + CP1256 windows + CP1257 windows + GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin cygwin + EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin + EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin + EUC-TW glibc aix hpux irix osf solaris netbsd + BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin cygwin + BIG5-HKSCS glibc hpux solaris netbsd darwin + GBK glibc aix osf solaris freebsd darwin cygwin windows dos + GB18030 glibc hpux solaris freebsd netbsd darwin + SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin + JOHAB glibc solaris windows + TIS-620 glibc aix hpux osf solaris cygwin + VISCII Y glibc + TCVN5712-1 glibc + ARMSCII-8 glibc freebsd netbsd darwin + GEORGIAN-PS glibc cygwin + PT154 glibc netbsd cygwin + HP-ROMAN8 hpux + HP-ARABIC8 hpux + HP-GREEK8 hpux + HP-HEBREW8 hpux + HP-TURKISH8 hpux + HP-KANA8 hpux + DEC-KANJI osf + DEC-HANYU osf + UTF-8 Y glibc aix hpux osf solaris netbsd darwin cygwin + + Note: Names which are not marked as being a MIME name should not be used in + Internet protocols for information interchange (mail, news, etc.). + + Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications + must understand both names and treat them as equivalent. + */ + #ifdef __cplusplus } diff --git a/gnu/locale.in.h b/gnu/locale.in.h index 7cb3f88f8e4e8ac76b47a2a3c1b42288ceb1ec78..5f33ed17cccb37174f393e351be1bcd3b0d99a54 100644 --- a/gnu/locale.in.h +++ b/gnu/locale.in.h @@ -1,5 +1,5 @@ /* A POSIX . - Copyright (C) 2007-2017 Free Software Foundation, Inc. + Copyright (C) 2007-2019 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 @@ -19,10 +19,13 @@ #endif @PRAGMA_COLUMNS@ -#ifdef _GL_ALREADY_INCLUDING_LOCALE_H +#if (defined _WIN32 && !defined __CYGWIN__ && defined __need_locale_t) \ + || defined _GL_ALREADY_INCLUDING_LOCALE_H -/* Special invocation conventions to handle Solaris header files - (through Solaris 10) when combined with gettext's libintl.h. */ +/* Special invocation convention: + - Inside mingw header files, + - To handle Solaris header files (through Solaris 10) when combined + with gettext's libintl.h. */ #@INCLUDE_NEXT@ @NEXT_LOCALE_H@ @@ -187,11 +190,40 @@ _GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - " # endif #endif -#if @GNULIB_DUPLOCALE@ +#if /*@GNULIB_NEWLOCALE@ ||*/ (@GNULIB_LOCALENAME@ && @HAVE_NEWLOCALE@) +# if @REPLACE_NEWLOCALE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef newlocale +# define newlocale rpl_newlocale +# define GNULIB_defined_newlocale 1 +# endif +_GL_FUNCDECL_RPL (newlocale, locale_t, + (int category_mask, const char *name, locale_t base) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (newlocale, locale_t, + (int category_mask, const char *name, locale_t base)); +# else +# if @HAVE_NEWLOCALE@ +_GL_CXXALIAS_SYS (newlocale, locale_t, + (int category_mask, const char *name, locale_t base)); +# endif +# endif +# if @HAVE_NEWLOCALE@ +_GL_CXXALIASWARN (newlocale); +# endif +#elif defined GNULIB_POSIXCHECK +# undef newlocale +# if HAVE_RAW_DECL_NEWLOCALE +_GL_WARN_ON_USE (newlocale, "newlocale is not portable"); +# endif +#endif + +#if @GNULIB_DUPLOCALE@ || (@GNULIB_LOCALENAME@ && @HAVE_DUPLOCALE@) # if @REPLACE_DUPLOCALE@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef duplocale # define duplocale rpl_duplocale +# define GNULIB_defined_duplocale 1 # endif _GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale)); @@ -211,6 +243,30 @@ _GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - " # endif #endif +#if /*@GNULIB_FREELOCALE@ ||*/ (@GNULIB_LOCALENAME@ && @HAVE_FREELOCALE@) +# if @REPLACE_FREELOCALE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef freelocale +# define freelocale rpl_freelocale +# define GNULIB_defined_freelocale 1 +# endif +_GL_FUNCDECL_RPL (freelocale, void, (locale_t locale) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (freelocale, void, (locale_t locale)); +# else +# if @HAVE_FREELOCALE@ +_GL_CXXALIAS_SYS (freelocale, void, (locale_t locale)); +# endif +# endif +# if @HAVE_FREELOCALE@ +_GL_CXXALIASWARN (freelocale); +# endif +#elif defined GNULIB_POSIXCHECK +# undef freelocale +# if HAVE_RAW_DECL_FREELOCALE +_GL_WARN_ON_USE (freelocale, "freelocale is not portable"); +# endif +#endif + #endif /* _@GUARD_PREFIX@_LOCALE_H */ -#endif /* ! _GL_ALREADY_INCLUDING_LOCALE_H */ #endif /* _@GUARD_PREFIX@_LOCALE_H */ +#endif /* !(__need_locale_t || _GL_ALREADY_INCLUDING_LOCALE_H) */ diff --git a/gnu/localeconv.c b/gnu/localeconv.c index 4fd3fec7ec84b304e91876ec734453a347bef696..b5a965f3e033e62d6ab11e129d1c62da1bdaedb7 100644 --- a/gnu/localeconv.c +++ b/gnu/localeconv.c @@ -1,5 +1,5 @@ /* Query locale dependent information for formatting numbers. - Copyright (C) 2012-2017 Free Software Foundation, Inc. + Copyright (C) 2012-2019 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 diff --git a/gnu/localtime-buffer.c b/gnu/localtime-buffer.c index c96c577ac1f42b0c03e7692baa1cdb2e22b9f83a..b65ea45af204450643d1e66d303a4740d9e8f047 100644 --- a/gnu/localtime-buffer.c +++ b/gnu/localtime-buffer.c @@ -1,6 +1,6 @@ /* Provide access to the last buffer returned by localtime() or gmtime(). - Copyright (C) 2001-2003, 2005-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2007, 2009-2019 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 @@ -34,6 +34,7 @@ struct tm *localtime_buffer_addr = &tm_zero_buffer; struct tm * rpl_localtime (time_t const *timep) +#undef localtime { struct tm *tm = localtime (timep); @@ -46,6 +47,7 @@ rpl_localtime (time_t const *timep) /* Same as above, since gmtime and localtime use the same buffer. */ struct tm * rpl_gmtime (time_t const *timep) +#undef gmtime { struct tm *tm = gmtime (timep); diff --git a/gnu/localtime-buffer.h b/gnu/localtime-buffer.h index 0a0389da0731f69a07334eac62dd7e77725da7f7..031111a752fee6680a488d0a82b14f6c8d9b0ee0 100644 --- a/gnu/localtime-buffer.h +++ b/gnu/localtime-buffer.h @@ -1,6 +1,6 @@ /* Provide access to the last buffer returned by localtime() or gmtime(). - Copyright (C) 2001-2003, 2005-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2007, 2009-2019 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 diff --git a/gnu/lseek.c b/gnu/lseek.c index 4c87bd5f27ad2ee876f8e5bb4f4a712b1db21347..46f7a3fa4e35bbbd44bed9b77da9d551a289acc0 100644 --- a/gnu/lseek.c +++ b/gnu/lseek.c @@ -1,5 +1,5 @@ /* An lseek() function that detects pipes. - Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2019 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 @@ -19,7 +19,7 @@ /* Specification. */ #include -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ /* Windows platforms. */ /* Get GetFileType. */ # include @@ -39,7 +39,7 @@ off_t rpl_lseek (int fd, off_t offset, int whence) { -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ /* mingw lseek mistakenly succeeds on pipes, sockets, and terminals. */ HANDLE h = (HANDLE) _get_osfhandle (fd); if (h == INVALID_HANDLE_VALUE) diff --git a/gnu/lstat.c b/gnu/lstat.c index c721a4e641c08b8e25d73900e56dad4071d6e9a7..d57ca105fd3b5783053969dfa71b1f9b40af9775 100644 --- a/gnu/lstat.c +++ b/gnu/lstat.c @@ -1,6 +1,6 @@ /* Work around a bug of lstat on some systems - Copyright (C) 1997-2006, 2008-2017 Free Software Foundation, Inc. + Copyright (C) 1997-2006, 2008-2019 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 @@ -47,6 +47,8 @@ orig_lstat (const char *filename, struct stat *buf) above. */ # include "sys/stat.h" +# include "stat-time.h" + # include # include @@ -66,32 +68,33 @@ orig_lstat (const char *filename, struct stat *buf) int rpl_lstat (const char *file, struct stat *sbuf) { - size_t len; - int lstat_result = orig_lstat (file, sbuf); - - if (lstat_result != 0) - return lstat_result; + int result = orig_lstat (file, sbuf); /* This replacement file can blindly check against '/' rather than using the ISSLASH macro, because all platforms with '\\' either lack symlinks (mingw) or have working lstat (cygwin) and thus do not compile this file. 0 len should have already been filtered out above, with a failure return of ENOENT. */ - len = strlen (file); - if (file[len - 1] != '/' || S_ISDIR (sbuf->st_mode)) - return 0; - - /* At this point, a trailing slash is only permitted on - symlink-to-dir; but it should have found information on the - directory, not the symlink. Call stat() to get info about the - link's referent. Our replacement stat guarantees valid results, - even if the symlink is not pointing to a directory. */ - if (!S_ISLNK (sbuf->st_mode)) + if (result == 0) { - errno = ENOTDIR; - return -1; + if (S_ISDIR (sbuf->st_mode) || file[strlen (file) - 1] != '/') + result = stat_time_normalize (result, sbuf); + else + { + /* At this point, a trailing slash is permitted only on + symlink-to-dir; but it should have found information on the + directory, not the symlink. Call 'stat' to get info about the + link's referent. Our replacement stat guarantees valid results, + even if the symlink is not pointing to a directory. */ + if (!S_ISLNK (sbuf->st_mode)) + { + errno = ENOTDIR; + return -1; + } + result = stat (file, sbuf); + } } - return stat (file, sbuf); + return result; } #endif /* HAVE_LSTAT */ diff --git a/gnu/malloc.c b/gnu/malloc.c index f13eb7b673120e4ddf7c792805ef0f85ae55283f..76e6ff764b7bbaca05904cad345651f04cece40a 100644 --- a/gnu/malloc.c +++ b/gnu/malloc.c @@ -1,6 +1,6 @@ /* malloc() function that is glibc compatible. - Copyright (C) 1997-1998, 2006-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1997-1998, 2006-2007, 2009-2019 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 diff --git a/gnu/malloca.c b/gnu/malloca.c index 4b3348d37b662cdec246b06bda4c283a0f799f3c..f60c5fb5d9353a3e10dafeee9ae8a3519e9f8d65 100644 --- a/gnu/malloca.c +++ b/gnu/malloca.c @@ -1,6 +1,6 @@ /* Safe automatic memory allocation. - Copyright (C) 2003, 2006-2007, 2009-2017 Free Software Foundation, Inc. - Written by Bruno Haible , 2003. + Copyright (C) 2003, 2006-2007, 2009-2019 Free Software Foundation, Inc. + Written by Bruno Haible , 2003, 2018. 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 @@ -21,92 +21,49 @@ /* Specification. */ #include "malloca.h" -#include - #include "verify.h" -/* Silence a warning from clang's MemorySanitizer. */ -#if defined __has_feature -# if __has_feature(memory_sanitizer) -# define NO_SANITIZE_MEMORY __attribute__((no_sanitize("memory"))) -# endif -#endif -#ifndef NO_SANITIZE_MEMORY -# define NO_SANITIZE_MEMORY -#endif - /* The speed critical point in this file is freea() applied to an alloca() result: it must be fast, to match the speed of alloca(). The speed of mmalloca() and freea() in the other case are not critical, because they - are only invoked for big memory sizes. */ - -#if HAVE_ALLOCA - -/* Store the mmalloca() results in a hash table. This is needed to reliably - distinguish a mmalloca() result and an alloca() result. - - Although it is possible that the same pointer is returned by alloca() and - by mmalloca() at different times in the same application, it does not lead - to a bug in freea(), because: - - Before a pointer returned by alloca() can point into malloc()ed memory, - the function must return, and once this has happened the programmer must - not call freea() on it anyway. - - Before a pointer returned by mmalloca() can point into the stack, it - must be freed. The only function that can free it is freea(), and - when freea() frees it, it also removes it from the hash table. */ - -#define MAGIC_NUMBER 0x1415fb4a -#define MAGIC_SIZE sizeof (int) -/* This is how the header info would look like without any alignment - considerations. */ -struct preliminary_header { void *next; int magic; }; -/* But the header's size must be a multiple of sa_alignment_max. */ -#define HEADER_SIZE \ - (((sizeof (struct preliminary_header) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max) -union header { - void *next; - struct { - char room[HEADER_SIZE - MAGIC_SIZE]; - int word; - } magic; -}; -verify (HEADER_SIZE == sizeof (union header)); -/* We make the hash table quite big, so that during lookups the probability - of empty hash buckets is quite high. There is no need to make the hash - table resizable, because when the hash table gets filled so much that the - lookup becomes slow, it means that the application has memory leaks. */ -#define HASH_TABLE_SIZE 257 -static void * mmalloca_results[HASH_TABLE_SIZE]; - -#endif + are only invoked for big memory sizes. + Here we use a bit in the address as an indicator, an idea by OndÅ™ej Bílka. + malloca() can return three types of pointers: + - Pointers ≡ 0 mod 2*sa_alignment_max come from stack allocation. + - Pointers ≡ sa_alignment_max mod 2*sa_alignment_max come from heap + allocation. + - NULL comes from a failed heap allocation. */ + +/* Type for holding very small pointer differences. */ +typedef unsigned char small_t; +/* Verify that it is wide enough. */ +verify (2 * sa_alignment_max - 1 <= (small_t) -1); void * mmalloca (size_t n) { #if HAVE_ALLOCA - /* Allocate one more word, that serves as an indicator for malloc()ed - memory, so that freea() of an alloca() result is fast. */ - size_t nplus = n + HEADER_SIZE; + /* Allocate one more word, used to determine the address to pass to freea(), + and room for the alignment ≡ sa_alignment_max mod 2*sa_alignment_max. */ + size_t nplus = n + sizeof (small_t) + 2 * sa_alignment_max - 1; if (nplus >= n) { - void *p = malloc (nplus); + char *mem = (char *) malloc (nplus); - if (p != NULL) + if (mem != NULL) { - size_t slot; - union header *h = p; - - p = h + 1; - - /* Put a magic number into the indicator word. */ - h->magic.word = MAGIC_NUMBER; - - /* Enter p into the hash table. */ - slot = (uintptr_t) p % HASH_TABLE_SIZE; - h->next = mmalloca_results[slot]; - mmalloca_results[slot] = p; - + char *p = + (char *)((((uintptr_t)mem + sizeof (small_t) + sa_alignment_max - 1) + & ~(uintptr_t)(2 * sa_alignment_max - 1)) + + sa_alignment_max); + /* Here p >= mem + sizeof (small_t), + and p <= mem + sizeof (small_t) + 2 * sa_alignment_max - 1 + hence p + n <= mem + nplus. + So, the memory range [p, p+n) lies in the allocated memory range + [mem, mem + nplus). */ + ((small_t *) p)[-1] = p - mem; + /* p ≡ sa_alignment_max mod 2*sa_alignment_max. */ return p; } } @@ -122,38 +79,27 @@ mmalloca (size_t n) } #if HAVE_ALLOCA -void NO_SANITIZE_MEMORY +void freea (void *p) { - /* mmalloca() may have returned NULL. */ - if (p != NULL) + /* Check argument. */ + if ((uintptr_t) p & (sa_alignment_max - 1)) { - /* Attempt to quickly distinguish the mmalloca() result - which has - a magic indicator word - and the alloca() result - which has an - uninitialized indicator word. It is for this test that sa_increment - additional bytes are allocated in the alloca() case. */ - if (((int *) p)[-1] == MAGIC_NUMBER) - { - /* Looks like a mmalloca() result. To see whether it really is one, - perform a lookup in the hash table. */ - size_t slot = (uintptr_t) p % HASH_TABLE_SIZE; - void **chain = &mmalloca_results[slot]; - for (; *chain != NULL;) - { - union header *h = p; - if (*chain == p) - { - /* Found it. Remove it from the hash table and free it. */ - union header *p_begin = h - 1; - *chain = p_begin->next; - free (p_begin); - return; - } - h = *chain; - chain = &h[-1].next; - } - } - /* At this point, we know it was not a mmalloca() result. */ + /* p was not the result of a malloca() call. Invalid argument. */ + abort (); + } + /* Determine whether p was a non-NULL pointer returned by mmalloca(). */ + if ((uintptr_t) p & sa_alignment_max) + { + void *mem = (char *) p - ((small_t *) p)[-1]; + free (mem); } } #endif + +/* + * Hey Emacs! + * Local Variables: + * coding: utf-8 + * End: + */ diff --git a/gnu/malloca.h b/gnu/malloca.h index d5155c73b78953b75577ac6e15e4acd570e1d65f..d80c316caa9434238801b61f20d905cad3300fdb 100644 --- a/gnu/malloca.h +++ b/gnu/malloca.h @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2003-2007, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify @@ -56,8 +56,10 @@ extern "C" { the function returns. Upon failure, it returns NULL. */ #if HAVE_ALLOCA # define malloca(N) \ - ((N) < 4032 - sa_increment \ - ? (void *) ((char *) alloca ((N) + sa_increment) + sa_increment) \ + ((N) < 4032 - (2 * sa_alignment_max - 1) \ + ? (void *) (((uintptr_t) (char *) alloca ((N) + 2 * sa_alignment_max - 1) \ + + (2 * sa_alignment_max - 1)) \ + & ~(uintptr_t)(2 * sa_alignment_max - 1)) \ : mmalloca (N)) #else # define malloca(N) \ @@ -119,10 +121,7 @@ enum | (sa_alignment_longlong - 1) #endif | (sa_alignment_longdouble - 1) - ) + 1, -/* The increment that guarantees room for a magic word must be >= sizeof (int) - and a multiple of sa_alignment_max. */ - sa_increment = ((sizeof (int) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max + ) + 1 }; #endif /* _MALLOCA_H */ diff --git a/gnu/malloca.valgrind b/gnu/malloca.valgrind deleted file mode 100644 index 52f0a50f57f2db64a2683a605e13e9cc3cd11f6d..0000000000000000000000000000000000000000 --- a/gnu/malloca.valgrind +++ /dev/null @@ -1,7 +0,0 @@ -# Suppress a valgrind message about use of uninitialized memory in freea(). -# This use is OK because it provides only a speedup. -{ - freea - Memcheck:Cond - fun:freea -} diff --git a/gnu/mbchar.c b/gnu/mbchar.c index edd6dc54ef3607b337089e4ab04b778c3dd503d7..aa8012b656f88a2651f22280fe0f23d85f0d9fc9 100644 --- a/gnu/mbchar.c +++ b/gnu/mbchar.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2006, 2009-2017 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2006, 2009-2019 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 diff --git a/gnu/mbchar.h b/gnu/mbchar.h index 469b80227745853cb25d11b2da9a4c58aeae1a13..2d26075cbb96f8d2b12a44987828ca3f9b48ab61 100644 --- a/gnu/mbchar.h +++ b/gnu/mbchar.h @@ -1,5 +1,5 @@ /* Multibyte character data type. - Copyright (C) 2001, 2005-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2001, 2005-2007, 2009-2019 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 diff --git a/gnu/mbrtowc.c b/gnu/mbrtowc.c index 28787c6e3a85f0352aedcd7e099e1fe4479fe1b5..bbe3f7a3b91ebc98854b9fe4ba68b7e43b4748bb 100644 --- a/gnu/mbrtowc.c +++ b/gnu/mbrtowc.c @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 1999-2002, 2005-2017 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2005-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify @@ -35,12 +35,60 @@ # include "streq.h" # include "verify.h" -#ifndef FALLTHROUGH -# if __GNUC__ < 7 -# define FALLTHROUGH ((void) 0) -# else -# define FALLTHROUGH __attribute__ ((__fallthrough__)) +# ifndef FALLTHROUGH +# if __GNUC__ < 7 +# define FALLTHROUGH ((void) 0) +# else +# define FALLTHROUGH __attribute__ ((__fallthrough__)) +# endif # endif + +/* Returns a classification of special values of the encoding of the current + locale. */ +typedef enum { + enc_other, /* other */ + enc_utf8, /* UTF-8 */ + enc_eucjp, /* EUC-JP */ + enc_94, /* EUC-KR, GB2312, BIG5 */ + enc_euctw, /* EUC-TW */ + enc_gb18030, /* GB18030 */ + enc_sjis /* SJIS */ +} enc_t; +static inline enc_t +locale_enc (void) +{ + const char *encoding = locale_charset (); + if (STREQ_OPT (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0)) + return enc_utf8; + if (STREQ_OPT (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0)) + return enc_eucjp; + if (STREQ_OPT (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0) + || STREQ_OPT (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0) + || STREQ_OPT (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0)) + return enc_94; + if (STREQ_OPT (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0)) + return enc_euctw; + if (STREQ_OPT (encoding, "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0)) + return enc_gb18030; + if (STREQ_OPT (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0)) + return enc_sjis; + return enc_other; +} + +#if GNULIB_WCHAR_SINGLE +/* When we know that the locale does not change, provide a speedup by + caching the value of locale_enc. */ +static int cached_locale_enc = -1; +static inline enc_t +locale_enc_cached (void) +{ + if (cached_locale_enc < 0) + cached_locale_enc = locale_enc (); + return cached_locale_enc; +} +#else +/* By default, don't make assumptions, hence no caching. */ +# define locale_enc_cached locale_enc #endif verify (sizeof (mbstate_t) >= 4); @@ -137,10 +185,9 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) if (m >= 4 || m >= MB_CUR_MAX) goto invalid; /* Here MB_CUR_MAX > 1 and 0 < m < 4. */ - { - const char *encoding = locale_charset (); - - if (STREQ_OPT (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0)) + switch (locale_enc_cached ()) + { + case enc_utf8: /* UTF-8 */ { /* Cf. unistr/u8-mblen.c. */ unsigned char c = (unsigned char) p[0]; @@ -197,8 +244,7 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) /* As a reference for this code, you can use the GNU libiconv implementation. Look for uses of the RET_TOOFEW macro. */ - if (STREQ_OPT (encoding, - "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0)) + case enc_eucjp: /* EUC-JP */ { if (m == 1) { @@ -221,12 +267,8 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) } goto invalid; } - if (STREQ_OPT (encoding, - "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0) - || STREQ_OPT (encoding, - "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0) - || STREQ_OPT (encoding, - "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0)) + + case enc_94: /* EUC-KR, GB2312, BIG5 */ { if (m == 1) { @@ -237,8 +279,8 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) } goto invalid; } - if (STREQ_OPT (encoding, - "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0)) + + case enc_euctw: /* EUC-TW */ { if (m == 1) { @@ -256,8 +298,8 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) } goto invalid; } - if (STREQ_OPT (encoding, - "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0)) + + case enc_gb18030: /* GB18030 */ { if (m == 1) { @@ -290,7 +332,8 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) } goto invalid; } - if (STREQ_OPT (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0)) + + case enc_sjis: /* SJIS */ { if (m == 1) { @@ -303,9 +346,10 @@ mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) goto invalid; } - /* An unknown multibyte encoding. */ - goto incomplete; - } + default: + /* An unknown multibyte encoding. */ + goto incomplete; + } incomplete: { diff --git a/gnu/mbscasecmp.c b/gnu/mbscasecmp.c index cf00b402fa007c7f4e0e7f6d554984dd7d33037c..86a5073b34e425996765221b44a3960616ba37ff 100644 --- a/gnu/mbscasecmp.c +++ b/gnu/mbscasecmp.c @@ -1,5 +1,5 @@ /* Case-insensitive string comparison function. - Copyright (C) 1998-1999, 2005-2017 Free Software Foundation, Inc. + Copyright (C) 1998-1999, 2005-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2005, based on earlier glibc code. diff --git a/gnu/mbsinit.c b/gnu/mbsinit.c index e429214f95ceb769551bde8d8cba6c1598c115cf..5ecaef77c72cbcb3b0cbc3774c96d3935d1bb370 100644 --- a/gnu/mbsinit.c +++ b/gnu/mbsinit.c @@ -1,5 +1,5 @@ /* Test for initial conversion state. - Copyright (C) 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify @@ -54,7 +54,7 @@ mbsinit (const mbstate_t *ps) int mbsinit (const mbstate_t *ps) { -# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ +# if defined _WIN32 && !defined __CYGWIN__ /* Native Windows. */ # ifdef __MINGW32__ /* On mingw, 'mbstate_t' is defined as 'int'. */ diff --git a/gnu/mbsrtowcs-impl.h b/gnu/mbsrtowcs-impl.h index 22b31cbeef590d6925fb7f4ee6c31811240ccb6c..110d692e16d0658c02973e2154ab1c32a743837c 100644 --- a/gnu/mbsrtowcs-impl.h +++ b/gnu/mbsrtowcs-impl.h @@ -1,5 +1,5 @@ /* Convert string to wide string. - Copyright (C) 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify diff --git a/gnu/mbsrtowcs-state.c b/gnu/mbsrtowcs-state.c index ae7256c0fd204617626300cd4fca1c9a41fff948..59525e72c4dde2eeebcd3047f16cd8a209be6bfc 100644 --- a/gnu/mbsrtowcs-state.c +++ b/gnu/mbsrtowcs-state.c @@ -1,5 +1,5 @@ /* Convert string to wide string. - Copyright (C) 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify diff --git a/gnu/mbsrtowcs.c b/gnu/mbsrtowcs.c index 7441c82d4832a740ded8d2234c08027bcd47e98e..14f241e30988a9d64b4b234d1580d1e4cae5f0ab 100644 --- a/gnu/mbsrtowcs.c +++ b/gnu/mbsrtowcs.c @@ -1,5 +1,5 @@ /* Convert string to wide string. - Copyright (C) 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify diff --git a/gnu/mbtowc-impl.h b/gnu/mbtowc-impl.h index 7cba7d395daeb343a385e79b318f0e3f936c1464..f4ab98181ff1b1bd8118ef9207eac1257165808d 100644 --- a/gnu/mbtowc-impl.h +++ b/gnu/mbtowc-impl.h @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 2011-2017 Free Software Foundation, Inc. + Copyright (C) 2011-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2011. This program is free software: you can redistribute it and/or modify diff --git a/gnu/mbtowc.c b/gnu/mbtowc.c index 4db254b92e0dae664fd018a2a5c403ff17aecf05..77a847241ea0553fccdbb5589ad1c9a7665eb703 100644 --- a/gnu/mbtowc.c +++ b/gnu/mbtowc.c @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 2011-2017 Free Software Foundation, Inc. + Copyright (C) 2011-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2011. This program is free software: you can redistribute it and/or modify diff --git a/gnu/mbuiter.h b/gnu/mbuiter.h index 25a13f88ea916a1f833039e616bcf93d535c82b5..dde69abc647421559ee86ee3f9d45750d7160bf4 100644 --- a/gnu/mbuiter.h +++ b/gnu/mbuiter.h @@ -1,5 +1,5 @@ /* Iterating through multibyte strings: macros for multi-byte encodings. - Copyright (C) 2001, 2005, 2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2001, 2005, 2007, 2009-2019 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 diff --git a/gnu/memchr.c b/gnu/memchr.c index 5f89177cf990baf42d7325ea68258303e84e4f9f..4e0c5f9de9a411cfe982237f468e74f9d103437e 100644 --- a/gnu/memchr.c +++ b/gnu/memchr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2017 +/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2019 Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), diff --git a/gnu/mempcpy.c b/gnu/mempcpy.c index b839a54e2f547d75354a5d87719f4d9dd973f3c0..d0220e10fb073df8576d33612fbfeb0bdcdc1712 100644 --- a/gnu/mempcpy.c +++ b/gnu/mempcpy.c @@ -1,5 +1,5 @@ /* Copy memory area and return pointer after last written byte. - Copyright (C) 2003, 2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2003, 2007, 2009-2019 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 diff --git a/gnu/memrchr.c b/gnu/memrchr.c index 29e56984cb1f99ccebc6e58a292b3107431a27e5..96022835cef9ebb85093817973d17ce685f3a43c 100644 --- a/gnu/memrchr.c +++ b/gnu/memrchr.c @@ -1,6 +1,6 @@ /* memrchr -- find the last occurrence of a byte in a memory block - Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2017 Free Software + Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2019 Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), @@ -68,7 +68,7 @@ __memrchr (void const *s, int c_in, size_t n) if (*--char_ptr == c) return (void *) char_ptr; - longword_ptr = (const longword *) char_ptr; + longword_ptr = (const void *) char_ptr; /* All these elucidatory comments refer to 4-byte longwords, but the theory applies equally well to any size longwords. */ diff --git a/gnu/minmax.h b/gnu/minmax.h index bbf14163c1bb145097711563edcf6c84b7dc44d0..d7f6bea0619c3ed8f78be287099045b9b0dfec8a 100644 --- a/gnu/minmax.h +++ b/gnu/minmax.h @@ -1,5 +1,5 @@ /* MIN, MAX macros. - Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2017 Free Software + Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/gnu/mkdir.c b/gnu/mkdir.c index c94c1ba8e4596f4abc1790a5e29a434b3d837013..b8320d00fef92c3c4d2f90f39ca79143e53d8d52 100644 --- a/gnu/mkdir.c +++ b/gnu/mkdir.c @@ -1,7 +1,7 @@ /* On some systems, mkdir ("foo/", 0700) fails because of the trailing slash. On those systems, this wrapper removes the trailing slash. - Copyright (C) 2001, 2003, 2006, 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2006, 2008-2019 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 @@ -38,7 +38,7 @@ Additionally, it declares _mkdir (and depending on compile flags, an alias mkdir), only in the nonstandard includes and , which are included in the override. */ -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ # define mkdir(name,mode) _mkdir (name) # define maybe_unused _GL_UNUSED #else diff --git a/gnu/mkdirat.c b/gnu/mkdirat.c index eb644da94b78f608dcfa5d870365771d81efc3c6..21c09cc800588a5bf03a5d186355540d9d817c7f 100644 --- a/gnu/mkdirat.c +++ b/gnu/mkdirat.c @@ -1,5 +1,5 @@ /* fd-relative mkdir - Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2019 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 diff --git a/gnu/mkdtemp.c b/gnu/mkdtemp.c index 9bd4ec9a94d6aa01b2971d5c0657dd1fffefe8a7..b1dd28dde839b0792cc224589af60c5d034606f3 100644 --- a/gnu/mkdtemp.c +++ b/gnu/mkdtemp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2001-2003, 2006-2007, 2009-2017 Free Software +/* Copyright (C) 1999, 2001-2003, 2006-2007, 2009-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. diff --git a/gnu/mkfifo.c b/gnu/mkfifo.c index af13362c2bbca58079001ee5e08eafb13640b35a..1878dca454478953f08f76f8cfbd23e095a2c74b 100644 --- a/gnu/mkfifo.c +++ b/gnu/mkfifo.c @@ -1,5 +1,5 @@ /* Create a named fifo. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/mkfifoat.c b/gnu/mkfifoat.c index def4a1475f31bd8c3a3975ba80d3b95e59081bed..8e44adeb65e2d219c0594bc2b84cc04f4b0bdb71 100644 --- a/gnu/mkfifoat.c +++ b/gnu/mkfifoat.c @@ -1,5 +1,5 @@ /* Create a named fifo relative to an open directory. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/mknod.c b/gnu/mknod.c index d12d4fe6031ffba565959f1073569e89287d4bfb..dbbfe29c46d834dc413572bffb59b1c00facb1e0 100644 --- a/gnu/mknod.c +++ b/gnu/mknod.c @@ -1,5 +1,5 @@ /* Create a device inode. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/mknodat.c b/gnu/mknodat.c index f9085582bda3df6f07eb26c47186e224ba26b39f..0cec0d309719b6722d99b2e833d3bb0b24dde414 100644 --- a/gnu/mknodat.c +++ b/gnu/mknodat.c @@ -1,5 +1,5 @@ /* Create an inode relative to an open directory. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 @@ -34,7 +34,7 @@ mknodat (int fd _GL_UNUSED, char const *path _GL_UNUSED, return -1; } -#else /* HAVE_MKFIFO */ +#else /* Create a file system node FILE relative to directory FD, with access permissions and file type in MODE, and device type in DEV. @@ -54,4 +54,4 @@ mknodat (int fd _GL_UNUSED, char const *path _GL_UNUSED, # undef AT_FUNC_POST_FILE_PARAM_DECLS # undef AT_FUNC_POST_FILE_ARGS -#endif /* HAVE_MKFIFO */ +#endif diff --git a/gnu/mktime-internal.h b/gnu/mktime-internal.h index 00e58abdd6cafb8d3f5c74b8d68d482e49a1024a..d13d89cfae78fe077c0ebf0c8d0cc02e9c31cb1f 100644 --- a/gnu/mktime-internal.h +++ b/gnu/mktime-internal.h @@ -1,6 +1,6 @@ /* mktime variant that also uses an offset guess - Copyright 2016-2017 Free Software Foundation, Inc. + Copyright 2016-2019 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 @@ -35,3 +35,19 @@ typedef int mktime_offset_t; time_t mktime_internal (struct tm *, struct tm * (*) (time_t const *, struct tm *), mktime_offset_t *); + +/* Although glibc source code uses leading underscores, Gnulib wants + ordinary names. + + Portable standalone applications should supply a that + declares a POSIX-compliant localtime_r, for the benefit of older + implementations that lack localtime_r or have a nonstandard one. + Similarly for gmtime_r. See the gnulib time_r module for one way + to implement this. */ + +#undef __gmtime_r +#undef __localtime_r +#define __gmtime_r gmtime_r +#define __localtime_r localtime_r + +#define __mktime_internal mktime_internal diff --git a/gnu/mktime.c b/gnu/mktime.c index dd7f0a3ab34aaf04871f43dc9eedb224f6c758d8..d411aa77058bf0b069614671fefff88e19193223 100644 --- a/gnu/mktime.c +++ b/gnu/mktime.c @@ -1,5 +1,5 @@ /* Convert a 'struct tm' to a time_t value. - Copyright (C) 1993-2017 Free Software Foundation, Inc. + Copyright (C) 1993-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Eggert . @@ -17,27 +17,21 @@ License along with the GNU C Library; if not, see . */ -/* Define this to 1 to have a standalone program to test this implementation of - mktime. */ -#ifndef DEBUG_MKTIME -# define DEBUG_MKTIME 0 -#endif - /* The following macros influence what gets defined when this file is compiled: Macro/expression Which gnulib module This compilation unit should define + _LIBC (glibc proper) mktime + NEED_MKTIME_WORKING mktime rpl_mktime || NEED_MKTIME_WINDOWS NEED_MKTIME_INTERNAL mktime-internal mktime_internal - - DEBUG_MKTIME (defined manually) my_mktime, main */ -#if !defined _LIBC && !DEBUG_MKTIME -# include +#ifndef _LIBC +# include #endif /* Assume that leap seconds are possible, unless told otherwise. @@ -49,34 +43,74 @@ #include +#include #include #include +#include +#include #include #include -#if DEBUG_MKTIME -# include -# include -# include -/* Make it work even if the system's libc has its own mktime routine. */ -# undef mktime -# define mktime my_mktime +#ifndef NEED_MKTIME_INTERNAL +# define NEED_MKTIME_INTERNAL 0 +#endif +#ifndef NEED_MKTIME_WINDOWS +# define NEED_MKTIME_WINDOWS 0 +#endif +#ifndef NEED_MKTIME_WORKING +# define NEED_MKTIME_WORKING 0 #endif -#if NEED_MKTIME_WINDOWS /* on native Windows */ -# include -# include +#include "mktime-internal.h" + +#if !defined _LIBC && (NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS) +static void +my_tzset (void) +{ +# if NEED_MKTIME_WINDOWS + /* Rectify the value of the environment variable TZ. + There are four possible kinds of such values: + - Traditional US time zone names, e.g. "PST8PDT". Syntax: see + + - Time zone names based on geography, that contain one or more + slashes, e.g. "Europe/Moscow". + - Time zone names based on geography, without slashes, e.g. + "Singapore". + - Time zone names that contain explicit DST rules. Syntax: see + + The Microsoft CRT understands only the first kind. It produces incorrect + results if the value of TZ is of the other kinds. + But in a Cygwin environment, /etc/profile.d/tzset.sh sets TZ to a value + of the second kind for most geographies, or of the first kind in a few + other geographies. If it is of the second kind, neutralize it. For the + Microsoft CRT, an absent or empty TZ means the time zone that the user + has set in the Windows Control Panel. + If the value of TZ is of the third or fourth kind -- Cygwin programs + understand these syntaxes as well --, it does not matter whether we + neutralize it or not, since these values occur only when a Cygwin user + has set TZ explicitly; this case is 1. rare and 2. under the user's + responsibility. */ + const char *tz = getenv ("TZ"); + if (tz != NULL && strchr (tz, '/') != NULL) + _putenv ("TZ="); +# elif HAVE_TZSET + tzset (); +# endif +} +# undef __tzset +# define __tzset() my_tzset () #endif -#if NEED_MKTIME_WORKING || NEED_MKTIME_INTERNAL || DEBUG_MKTIME +#if defined _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_INTERNAL /* A signed type that can represent an integer number of years - multiplied by three times the number of seconds in a year. It is + multiplied by four times the number of seconds in a year. It is needed when converting a tm_year value times the number of seconds - in a year. The factor of three comes because these products need + in a year. The factor of four comes because these products need to be subtracted from each other, and sometimes with an offset - added to them, without worrying about overflow. + added to them, and then with another timestamp added, without + worrying about overflow. Much of the code uses long_int to represent time_t values, to lessen the hassle of dealing with platforms where time_t is @@ -84,12 +118,12 @@ time_t values that mktime can generate even on platforms where time_t is excessively wide. */ -#if INT_MAX <= LONG_MAX / 3 / 366 / 24 / 60 / 60 +#if INT_MAX <= LONG_MAX / 4 / 366 / 24 / 60 / 60 typedef long int long_int; #else typedef long long int long_int; #endif -verify (INT_MAX <= TYPE_MAXIMUM (long_int) / 3 / 366 / 24 / 60 / 60); +verify (INT_MAX <= TYPE_MAXIMUM (long_int) / 4 / 366 / 24 / 60 / 60); /* Shift A right by B bits portably, by dividing A by 2**B and truncating towards minus infinity. B should be in the range 0 <= B @@ -150,19 +184,6 @@ const unsigned short int __mon_yday[2][13] = }; -#ifdef _LIBC -typedef time_t mktime_offset_t; -#else -/* Portable standalone applications should supply a that - declares a POSIX-compliant localtime_r, for the benefit of older - implementations that lack localtime_r or have a nonstandard one. - See the gnulib time_r module for one way to implement this. */ -# undef __localtime_r -# define __localtime_r localtime_r -# define __mktime_internal mktime_internal -# include "mktime-internal.h" -#endif - /* Do the values A and B differ according to the rules for tm_isdst? A and B differ if one is zero and the other positive. */ static bool @@ -176,9 +197,10 @@ isdst_differ (int a, int b) were not adjusted between the timestamps. The YEAR values uses the same numbering as TP->tm_year. Values - need not be in the usual range. However, YEAR1 must not overflow - when multiplied by three times the number of seconds in a year, and - likewise for YDAY1 and three times the number of seconds in a day. */ + need not be in the usual range. However, YEAR1 - YEAR0 must not + overflow even when multiplied by three times the number of seconds + in a year, and likewise for YDAY1 - YDAY0 and three times the + number of seconds in a day. */ static long_int ydhms_diff (long_int year1, long_int yday1, int hour1, int min1, int sec1, @@ -213,43 +235,25 @@ long_int_avg (long_int a, long_int b) return shr (a, 1) + shr (b, 1) + ((a | b) & 1); } -/* Return a time_t value corresponding to (YEAR-YDAY HOUR:MIN:SEC), - assuming that T corresponds to *TP and that no clock adjustments - occurred between *TP and the desired time. - Although T and the returned value are of type long_int, - they represent time_t values and must be in time_t range. - If TP is null, return a value not equal to T; this avoids false matches. +/* Return a long_int value corresponding to (YEAR-YDAY HOUR:MIN:SEC) + minus *TP seconds, assuming no clock adjustments occurred between + the two timestamps. + YEAR and YDAY must not be so large that multiplying them by three times the number of seconds in a year (or day, respectively) would overflow long_int. - If the returned value would be out of range, yield the minimal or - maximal in-range value, except do not yield a value equal to T. */ + *TP should be in the usual range. */ static long_int -guess_time_tm (long_int year, long_int yday, int hour, int min, int sec, - long_int t, const struct tm *tp) +tm_diff (long_int year, long_int yday, int hour, int min, int sec, + struct tm const *tp) { - if (tp) - { - long_int result; - long_int d = ydhms_diff (year, yday, hour, min, sec, - tp->tm_year, tp->tm_yday, - tp->tm_hour, tp->tm_min, tp->tm_sec); - if (! INT_ADD_WRAPV (t, d, &result)) - return result; - } - - /* Overflow occurred one way or another. Return the nearest result - that is actually in range, except don't report a zero difference - if the actual difference is nonzero, as that would cause a false - match; and don't oscillate between two values, as that would - confuse the spring-forward gap detector. */ - return (t < long_int_avg (mktime_min, mktime_max) - ? (t <= mktime_min + 1 ? t + 1 : mktime_min) - : (mktime_max - 1 <= t ? t - 1 : mktime_max)); + return ydhms_diff (year, yday, hour, min, sec, + tp->tm_year, tp->tm_yday, + tp->tm_hour, tp->tm_min, tp->tm_sec); } /* Use CONVERT to convert T to a struct tm value in *TM. T must be in - range for time_t. Return TM if successful, NULL if T is out of - range for CONVERT. */ + range for time_t. Return TM if successful, NULL (setting errno) on + failure. */ static struct tm * convert_time (struct tm *(*convert) (const time_t *, struct tm *), long_int t, struct tm *tm) @@ -261,61 +265,64 @@ convert_time (struct tm *(*convert) (const time_t *, struct tm *), /* Use CONVERT to convert *T to a broken down time in *TP. If *T is out of range for conversion, adjust it so that it is the nearest in-range value and then convert that. - A value is in range if it fits in both time_t and long_int. */ + A value is in range if it fits in both time_t and long_int. + Return TP on success, NULL (setting errno) on failure. */ static struct tm * ranged_convert (struct tm *(*convert) (const time_t *, struct tm *), long_int *t, struct tm *tp) { - struct tm *r; - if (*t < mktime_min) - *t = mktime_min; - else if (mktime_max < *t) - *t = mktime_max; - r = convert_time (convert, *t, tp); - - if (!r && *t) + long_int t1 = (*t < mktime_min ? mktime_min + : *t <= mktime_max ? *t : mktime_max); + struct tm *r = convert_time (convert, t1, tp); + if (r) { - long_int bad = *t; - long_int ok = 0; + *t = t1; + return r; + } + if (errno != EOVERFLOW) + return NULL; - /* BAD is a known unconvertible value, and OK is a known good one. - Use binary search to narrow the range between BAD and OK until - they differ by 1. */ - while (true) - { - long_int mid = long_int_avg (ok, bad); - if (mid != ok && mid != bad) - break; - r = convert_time (convert, mid, tp); - if (r) - ok = mid; - else - bad = mid; - } + long_int bad = t1; + long_int ok = 0; + struct tm oktm; oktm.tm_sec = -1; - if (!r && ok) - { - /* The last conversion attempt failed; - revert to the most recent successful attempt. */ - r = convert_time (convert, ok, tp); - } + /* BAD is a known out-of-range value, and OK is a known in-range one. + Use binary search to narrow the range between BAD and OK until + they differ by 1. */ + while (true) + { + long_int mid = long_int_avg (ok, bad); + if (mid == ok || mid == bad) + break; + if (convert_time (convert, mid, tp)) + ok = mid, oktm = *tp; + else if (errno != EOVERFLOW) + return NULL; + else + bad = mid; } - return r; + if (oktm.tm_sec < 0) + return NULL; + *t = ok; + *tp = oktm; + return tp; } + /* Convert *TP to a time_t value, inverting the monotonic and mostly-unit-linear conversion function CONVERT. Use *OFFSET to keep track of a guess at the offset of the result, compared to what the result would be for UTC without leap seconds. If *OFFSET's guess is correct, only one CONVERT call is needed. + If successful, set *TP to the canonicalized struct tm; + otherwise leave *TP alone, return ((time_t) -1) and set errno. This function is external because it is used also by timegm.c. */ time_t __mktime_internal (struct tm *tp, struct tm *(*convert) (const time_t *, struct tm *), mktime_offset_t *offset) { - long_int t, gt, t0, t1, t2, dt; struct tm tm; /* The maximum number of probes (calls to CONVERT) should be enough @@ -335,7 +342,7 @@ __mktime_internal (struct tm *tp, int isdst = tp->tm_isdst; /* 1 if the previous probe was DST. */ - int dst2; + int dst2 = 0; /* Ensure that mon is in range, and set year accordingly. */ int mon_remainder = mon % 12; @@ -355,6 +362,7 @@ __mktime_internal (struct tm *tp, long_int lmday = mday; long_int yday = mon_yday + lmday; + mktime_offset_t off = *offset; int negative_offset_guess; int sec_requested = sec; @@ -362,7 +370,7 @@ __mktime_internal (struct tm *tp, if (LEAP_SECONDS_POSSIBLE) { /* Handle out-of-range seconds specially, - since ydhms_tm_diff assumes every minute has 60 seconds. */ + since ydhms_diff assumes every minute has 60 seconds. */ if (sec < 0) sec = 0; if (59 < sec) @@ -372,34 +380,47 @@ __mktime_internal (struct tm *tp, /* Invert CONVERT by probing. First assume the same offset as last time. */ - INT_SUBTRACT_WRAPV (0, *offset, &negative_offset_guess); - t0 = ydhms_diff (year, yday, hour, min, sec, - EPOCH_YEAR - TM_YEAR_BASE, 0, 0, 0, negative_offset_guess); + INT_SUBTRACT_WRAPV (0, off, &negative_offset_guess); + long_int t0 = ydhms_diff (year, yday, hour, min, sec, + EPOCH_YEAR - TM_YEAR_BASE, 0, 0, 0, + negative_offset_guess); + long_int t = t0, t1 = t0, t2 = t0; /* Repeatedly use the error to improve the guess. */ - for (t = t1 = t2 = t0, dst2 = 0; - (gt = guess_time_tm (year, yday, hour, min, sec, t, - ranged_convert (convert, &t, &tm)), - t != gt); - t1 = t2, t2 = t, t = gt, dst2 = tm.tm_isdst != 0) - if (t == t1 && t != t2 - && (tm.tm_isdst < 0 - || (isdst < 0 - ? dst2 <= (tm.tm_isdst != 0) - : (isdst != 0) != (tm.tm_isdst != 0)))) - /* We can't possibly find a match, as we are oscillating - between two values. The requested time probably falls - within a spring-forward gap of size GT - T. Follow the common - practice in this case, which is to return a time that is GT - T - away from the requested time, preferring a time whose - tm_isdst differs from the requested value. (If no tm_isdst - was requested and only one of the two values has a nonzero - tm_isdst, prefer that value.) In practice, this is more - useful than returning -1. */ - goto offset_found; - else if (--remaining_probes == 0) - return -1; + while (true) + { + if (! ranged_convert (convert, &t, &tm)) + return -1; + long_int dt = tm_diff (year, yday, hour, min, sec, &tm); + if (dt == 0) + break; + + if (t == t1 && t != t2 + && (tm.tm_isdst < 0 + || (isdst < 0 + ? dst2 <= (tm.tm_isdst != 0) + : (isdst != 0) != (tm.tm_isdst != 0)))) + /* We can't possibly find a match, as we are oscillating + between two values. The requested time probably falls + within a spring-forward gap of size DT. Follow the common + practice in this case, which is to return a time that is DT + away from the requested time, preferring a time whose + tm_isdst differs from the requested value. (If no tm_isdst + was requested and only one of the two values has a nonzero + tm_isdst, prefer that value.) In practice, this is more + useful than returning -1. */ + goto offset_found; + + remaining_probes--; + if (remaining_probes == 0) + { + __set_errno (EOVERFLOW); + return -1; + } + + t1 = t2, t2 = t, t += dt, dst2 = tm.tm_isdst != 0; + } /* We have a match. Check whether tm.tm_isdst has the requested value, if any. */ @@ -441,25 +462,38 @@ __mktime_internal (struct tm *tp, if (! INT_ADD_WRAPV (t, delta * direction, &ot)) { struct tm otm; - ranged_convert (convert, &ot, &otm); + if (! ranged_convert (convert, &ot, &otm)) + return -1; if (! isdst_differ (isdst, otm.tm_isdst)) { /* We found the desired tm_isdst. Extrapolate back to the desired time. */ - t = guess_time_tm (year, yday, hour, min, sec, ot, &otm); - ranged_convert (convert, &t, &tm); - goto offset_found; + long_int gt = ot + tm_diff (year, yday, hour, min, sec, + &otm); + if (mktime_min <= gt && gt <= mktime_max) + { + if (convert_time (convert, gt, &tm)) + { + t = gt; + goto offset_found; + } + if (errno != EOVERFLOW) + return -1; + } } } } + + __set_errno (EOVERFLOW); + return -1; } offset_found: /* Set *OFFSET to the low-order bits of T - T0 - NEGATIVE_OFFSET_GUESS. This is just a heuristic to speed up the next mktime call, and correctness is unaffected if integer overflow occurs here. */ - INT_SUBTRACT_WRAPV (t, t0, &dt); - INT_SUBTRACT_WRAPV (dt, negative_offset_guess, offset); + INT_SUBTRACT_WRAPV (t, t0, offset); + INT_SUBTRACT_WRAPV (*offset, negative_offset_guess, offset); if (LEAP_SECONDS_POSSIBLE && sec_requested != tm.tm_sec) { @@ -469,8 +503,12 @@ __mktime_internal (struct tm *tp, sec_adjustment -= sec; sec_adjustment += sec_requested; if (INT_ADD_WRAPV (t, sec_adjustment, &t) - || ! (mktime_min <= t && t <= mktime_max) - || ! convert_time (convert, t, &tm)) + || ! (mktime_min <= t && t <= mktime_max)) + { + __set_errno (EOVERFLOW); + return -1; + } + if (! convert_time (convert, t, &tm)) return -1; } @@ -478,64 +516,28 @@ __mktime_internal (struct tm *tp, return t; } -#endif /* NEED_MKTIME_WORKING || NEED_MKTIME_INTERNAL || DEBUG_MKTIME */ +#endif /* _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_INTERNAL */ -#if NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS || DEBUG_MKTIME - -# if NEED_MKTIME_WORKING || DEBUG_MKTIME -static mktime_offset_t localtime_offset; -# endif +#if defined _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS /* Convert *TP to a time_t value. */ time_t mktime (struct tm *tp) { -# if NEED_MKTIME_WINDOWS - /* Rectify the value of the environment variable TZ. - There are four possible kinds of such values: - - Traditional US time zone names, e.g. "PST8PDT". Syntax: see - - - Time zone names based on geography, that contain one or more - slashes, e.g. "Europe/Moscow". - - Time zone names based on geography, without slashes, e.g. - "Singapore". - - Time zone names that contain explicit DST rules. Syntax: see - - The Microsoft CRT understands only the first kind. It produces incorrect - results if the value of TZ is of the other kinds. - But in a Cygwin environment, /etc/profile.d/tzset.sh sets TZ to a value - of the second kind for most geographies, or of the first kind in a few - other geographies. If it is of the second kind, neutralize it. For the - Microsoft CRT, an absent or empty TZ means the time zone that the user - has set in the Windows Control Panel. - If the value of TZ is of the third or fourth kind -- Cygwin programs - understand these syntaxes as well --, it does not matter whether we - neutralize it or not, since these values occur only when a Cygwin user - has set TZ explicitly; this case is 1. rare and 2. under the user's - responsibility. */ - const char *tz = getenv ("TZ"); - if (tz != NULL && strchr (tz, '/') != NULL) - _putenv ("TZ="); -# endif - -# if NEED_MKTIME_WORKING || DEBUG_MKTIME -# ifdef _LIBC /* POSIX.1 8.1.1 requires that whenever mktime() is called, the time zone names contained in the external variable 'tzname' shall be set as if the tzset() function had been called. */ __tzset (); -# elif HAVE_TZSET - tzset (); -# endif +# if defined _LIBC || NEED_MKTIME_WORKING + static mktime_offset_t localtime_offset; return __mktime_internal (tp, __localtime_r, &localtime_offset); # else # undef mktime return mktime (tp); # endif } - -#endif /* NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS || DEBUG_MKTIME */ +#endif /* _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS */ #ifdef weak_alias weak_alias (mktime, timelocal) @@ -545,146 +547,3 @@ weak_alias (mktime, timelocal) libc_hidden_def (mktime) libc_hidden_weak (timelocal) #endif - -#if DEBUG_MKTIME - -static int -not_equal_tm (const struct tm *a, const struct tm *b) -{ - return ((a->tm_sec ^ b->tm_sec) - | (a->tm_min ^ b->tm_min) - | (a->tm_hour ^ b->tm_hour) - | (a->tm_mday ^ b->tm_mday) - | (a->tm_mon ^ b->tm_mon) - | (a->tm_year ^ b->tm_year) - | (a->tm_yday ^ b->tm_yday) - | isdst_differ (a->tm_isdst, b->tm_isdst)); -} - -static void -print_tm (const struct tm *tp) -{ - if (tp) - printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d", - tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday, - tp->tm_hour, tp->tm_min, tp->tm_sec, - tp->tm_yday, tp->tm_wday, tp->tm_isdst); - else - printf ("0"); -} - -static int -check_result (time_t tk, struct tm tmk, time_t tl, const struct tm *lt) -{ - if (tk != tl || !lt || not_equal_tm (&tmk, lt)) - { - printf ("mktime ("); - print_tm (lt); - printf (")\nyields ("); - print_tm (&tmk); - printf (") == %ld, should be %ld\n", (long int) tk, (long int) tl); - return 1; - } - - return 0; -} - -int -main (int argc, char **argv) -{ - int status = 0; - struct tm tm, tmk, tml; - struct tm *lt; - time_t tk, tl, tl1; - char trailer; - - /* Sanity check, plus call tzset. */ - tl = 0; - if (! localtime (&tl)) - { - printf ("localtime (0) fails\n"); - status = 1; - } - - if ((argc == 3 || argc == 4) - && (sscanf (argv[1], "%d-%d-%d%c", - &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer) - == 3) - && (sscanf (argv[2], "%d:%d:%d%c", - &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer) - == 3)) - { - tm.tm_year -= TM_YEAR_BASE; - tm.tm_mon--; - tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]); - tmk = tm; - tl = mktime (&tmk); - lt = localtime_r (&tl, &tml); - printf ("mktime returns %ld == ", (long int) tl); - print_tm (&tmk); - printf ("\n"); - status = check_result (tl, tmk, tl, lt); - } - else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0)) - { - time_t from = atol (argv[1]); - time_t by = atol (argv[2]); - time_t to = atol (argv[3]); - - if (argc == 4) - for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1) - { - lt = localtime_r (&tl, &tml); - if (lt) - { - tmk = tml; - tk = mktime (&tmk); - status |= check_result (tk, tmk, tl, &tml); - } - else - { - printf ("localtime_r (%ld) yields 0\n", (long int) tl); - status = 1; - } - tl1 = tl + by; - if ((tl1 < tl) != (by < 0)) - break; - } - else - for (tl = from; by < 0 ? to <= tl : tl <= to; tl = tl1) - { - /* Null benchmark. */ - lt = localtime_r (&tl, &tml); - if (lt) - { - tmk = tml; - tk = tl; - status |= check_result (tk, tmk, tl, &tml); - } - else - { - printf ("localtime_r (%ld) yields 0\n", (long int) tl); - status = 1; - } - tl1 = tl + by; - if ((tl1 < tl) != (by < 0)) - break; - } - } - else - printf ("Usage:\ -\t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\ -\t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\ -\t%s FROM BY TO - # Do not test those values (for benchmark).\n", - argv[0], argv[0], argv[0]); - - return status; -} - -#endif /* DEBUG_MKTIME */ - -/* -Local Variables: -compile-command: "gcc -DDEBUG_MKTIME -I. -Wall -W -O2 -g mktime.c -o mktime" -End: -*/ diff --git a/gnu/modechange.c b/gnu/modechange.c index c96e6d0fe30b6b5d4348a0782e8f9f60e190e331..29ba48726c801b48a030dd8fe22d68d9e3a667aa 100644 --- a/gnu/modechange.c +++ b/gnu/modechange.c @@ -1,6 +1,6 @@ /* modechange.c -- file mode manipulation - Copyright (C) 1989-1990, 1997-1999, 2001, 2003-2006, 2009-2017 Free Software + Copyright (C) 1989-1990, 1997-1999, 2001, 2003-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/modechange.h b/gnu/modechange.h index 991fa09d9b21a5f37178bc02b62f314306c2af95..a1cc243231d4abf05a8a5d67fc18de5f4783f2dc 100644 --- a/gnu/modechange.h +++ b/gnu/modechange.h @@ -1,6 +1,6 @@ /* modechange.h -- definitions for file mode manipulation - Copyright (C) 1989-1990, 1997, 2003-2006, 2009-2017 Free Software + Copyright (C) 1989-1990, 1997, 2003-2006, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/msvc-inval.c b/gnu/msvc-inval.c index fced1178a31174697662cb32588d319f2ed9fa6f..75b5a070ab5962b2c9e8749ca1f55dd22c8f0fa3 100644 --- a/gnu/msvc-inval.c +++ b/gnu/msvc-inval.c @@ -1,5 +1,5 @@ /* Invalid parameter handler for MSVC runtime libraries. - Copyright (C) 2011-2017 Free Software Foundation, Inc. + Copyright (C) 2011-2019 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 diff --git a/gnu/msvc-inval.h b/gnu/msvc-inval.h index b544a46ea6fc500d1d6efde21bf143b0ec45ea37..e31cf650919ab5ce3279e30243d072efab2fcf7e 100644 --- a/gnu/msvc-inval.h +++ b/gnu/msvc-inval.h @@ -1,5 +1,5 @@ /* Invalid parameter handler for MSVC runtime libraries. - Copyright (C) 2011-2017 Free Software Foundation, Inc. + Copyright (C) 2011-2019 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 diff --git a/gnu/msvc-nothrow.c b/gnu/msvc-nothrow.c index b74b22282c6ec02a92b0be526c1147e191275ddf..49b709ca4aa03e6c53dd1f9db58b3afa5b1a9274 100644 --- a/gnu/msvc-nothrow.c +++ b/gnu/msvc-nothrow.c @@ -1,6 +1,6 @@ /* Wrappers that don't throw invalid parameter notifications with MSVC runtime libraries. - Copyright (C) 2011-2017 Free Software Foundation, Inc. + Copyright (C) 2011-2019 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 diff --git a/gnu/msvc-nothrow.h b/gnu/msvc-nothrow.h index b0622c0b588c27d231e9925b2a38e00661a729cb..8d3ca7892e89d24016636bf1c8ffdf8d8ae2349b 100644 --- a/gnu/msvc-nothrow.h +++ b/gnu/msvc-nothrow.h @@ -1,6 +1,6 @@ /* Wrappers that don't throw invalid parameter notifications with MSVC runtime libraries. - Copyright (C) 2011-2017 Free Software Foundation, Inc. + Copyright (C) 2011-2019 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 @@ -25,7 +25,7 @@ This file defines wrappers that turn such an invalid parameter notification into an error code. */ -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ /* Get original declaration of _get_osfhandle. */ # include diff --git a/gnu/nl_langinfo.c b/gnu/nl_langinfo.c index 3e554e3d25ef520c8cc5f451acb4a733582b9ca3..e8a5595aeed9364d72c2059a23800c433a5e4928 100644 --- a/gnu/nl_langinfo.c +++ b/gnu/nl_langinfo.c @@ -1,6 +1,6 @@ /* nl_langinfo() replacement: query locale dependent information. - Copyright (C) 2007-2017 Free Software Foundation, Inc. + Copyright (C) 2007-2019 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 @@ -22,12 +22,13 @@ #include #include -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ # define WIN32_LEAN_AND_MEAN /* avoid including junk */ # include # include #endif +#if !REPLACE_NL_LANGINFO || GNULIB_defined_CODESET /* Return the codeset of the current locale, if this is easily deducible. Otherwise, return "". */ static char * @@ -64,7 +65,7 @@ ctype_codeset (void) } } -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# if defined _WIN32 && ! defined __CYGWIN__ /* If setlocale is successful, it returns the number of the codepage, as a string. Otherwise, fall back on Windows API GetACP, which returns the locale's codepage as a number (although @@ -76,9 +77,10 @@ ctype_codeset (void) else sprintf (buf + 2, "%u", GetACP ()); codeset = memcpy (buf, "CP", 2); -#endif +# endif return codeset; } +#endif #if REPLACE_NL_LANGINFO @@ -100,6 +102,24 @@ rpl_nl_langinfo (nl_item item) case T_FMT_AMPM: return (char *) "%I:%M:%S %p"; # endif +# if GNULIB_defined_ALTMON + case ALTMON_1: + case ALTMON_2: + case ALTMON_3: + case ALTMON_4: + case ALTMON_5: + case ALTMON_6: + case ALTMON_7: + case ALTMON_8: + case ALTMON_9: + case ALTMON_10: + case ALTMON_11: + case ALTMON_12: + /* We don't ship the appropriate localizations with gnulib. Therefore, + treat ALTMON_i like MON_i. */ + item = item - ALTMON_1 + MON_1; + break; +# endif # if GNULIB_defined_ERA case ERA: /* The format is not standardized. In glibc it is a sequence of strings @@ -171,8 +191,10 @@ nl_langinfo (nl_item item) return localeconv () ->decimal_point; case THOUSEP: return localeconv () ->thousands_sep; +# ifdef GROUPING case GROUPING: return localeconv () ->grouping; +# endif /* nl_langinfo items of the LC_TIME category. TODO: Really use the locale. */ case D_T_FMT: @@ -228,28 +250,49 @@ nl_langinfo (nl_item item) return (char *) abdays[item - ABDAY_1]; return nlbuf; } - case MON_1: - case MON_2: - case MON_3: - case MON_4: - case MON_5: - case MON_6: - case MON_7: - case MON_8: - case MON_9: - case MON_10: - case MON_11: - case MON_12: - { - static char const months[][sizeof "September"] = { - "January", "February", "March", "April", "May", "June", "July", - "September", "October", "November", "December" - }; + { + static char const months[][sizeof "September"] = { + "January", "February", "March", "April", "May", "June", "July", + "September", "October", "November", "December" + }; + case MON_1: + case MON_2: + case MON_3: + case MON_4: + case MON_5: + case MON_6: + case MON_7: + case MON_8: + case MON_9: + case MON_10: + case MON_11: + case MON_12: tmm.tm_mon = item - MON_1; if (!strftime (nlbuf, sizeof nlbuf, "%B", &tmm)) return (char *) months[item - MON_1]; return nlbuf; - } + case ALTMON_1: + case ALTMON_2: + case ALTMON_3: + case ALTMON_4: + case ALTMON_5: + case ALTMON_6: + case ALTMON_7: + case ALTMON_8: + case ALTMON_9: + case ALTMON_10: + case ALTMON_11: + case ALTMON_12: + tmm.tm_mon = item - ALTMON_1; + /* The platforms without nl_langinfo() don't support strftime with %OB. + We don't even need to try. */ + #if 0 + if (!strftime (nlbuf, sizeof nlbuf, "%OB", &tmm)) + #endif + if (!strftime (nlbuf, sizeof nlbuf, "%B", &tmm)) + return (char *) months[item - ALTMON_1]; + return nlbuf; + } case ABMON_1: case ABMON_2: case ABMON_3: @@ -279,6 +322,7 @@ nl_langinfo (nl_item item) /* nl_langinfo items of the LC_MONETARY category. */ case CRNCYSTR: return localeconv () ->currency_symbol; +# ifdef INT_CURR_SYMBOL case INT_CURR_SYMBOL: return localeconv () ->int_curr_symbol; case MON_DECIMAL_POINT: @@ -307,6 +351,7 @@ nl_langinfo (nl_item item) return & localeconv () ->p_sign_posn; case N_SIGN_POSN: return & localeconv () ->n_sign_posn; +# endif /* nl_langinfo items of the LC_MESSAGES category TODO: Really use the locale. */ case YESEXPR: diff --git a/gnu/nstrftime.c b/gnu/nstrftime.c index 8795cd729d72a48bea880975b89d0fa0926c25ad..71f778a5fe7ca0825d6766b35938d662c692b040 100644 --- a/gnu/nstrftime.c +++ b/gnu/nstrftime.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2017 Free Software Foundation, Inc. +/* Copyright (C) 1991-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -91,6 +91,7 @@ extern char *tzname[]; # define UCHAR_T unsigned char # define L_(Str) Str # define NLW(Sym) Sym +# define ABALTMON_1 _NL_ABALTMON_1 # define MEMCPY(d, s, n) memcpy (d, s, n) # define STRLEN(s) strlen (s) @@ -255,7 +256,7 @@ extern char *tzname[]; # undef _NL_CURRENT # define _NL_CURRENT(category, item) \ (current->values[_NL_ITEM_INDEX (item)].string) -# define LOCALE_PARAM , __locale_t loc +# define LOCALE_PARAM , locale_t loc # define LOCALE_ARG , loc # define HELPER_LOCALE_ARG , current #else @@ -475,12 +476,19 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) # define f_month \ ((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11 \ ? "?" : _NL_CURRENT (LC_TIME, NLW(MON_1) + tp->tm_mon))) +# define a_altmonth \ + ((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11 \ + ? "?" : _NL_CURRENT (LC_TIME, NLW(ABALTMON_1) + tp->tm_mon))) +# define f_altmonth \ + ((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11 \ + ? "?" : _NL_CURRENT (LC_TIME, NLW(ALTMON_1) + tp->tm_mon))) # define ampm \ ((const CHAR_T *) _NL_CURRENT (LC_TIME, tp->tm_hour > 11 \ ? NLW(PM_STR) : NLW(AM_STR))) # define aw_len STRLEN (a_wkday) # define am_len STRLEN (a_month) +# define aam_len STRLEN (a_altmonth) # define ap_len STRLEN (ampm) #endif #if HAVE_TZNAME @@ -808,17 +816,20 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) to_uppcase = true; to_lowcase = false; } - if (modifier != 0) + if (modifier == L_('E')) goto bad_format; #ifdef _NL_CURRENT - cpy (am_len, a_month); + if (modifier == L_('O')) + cpy (aam_len, a_altmonth); + else + cpy (am_len, a_month); break; #else goto underlying_strftime; #endif case L_('B'): - if (modifier != 0) + if (modifier == L_('E')) goto bad_format; if (change_case) { @@ -826,7 +837,10 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) to_lowcase = false; } #ifdef _NL_CURRENT - cpy (STRLEN (f_month), f_month); + if (modifier == L_('O')) + cpy (STRLEN (f_altmonth), f_altmonth); + else + cpy (STRLEN (f_month), f_month); break; #else goto underlying_strftime; @@ -1424,28 +1438,10 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) # endif ltm = *tp; + ltm.tm_wday = -1; lt = mktime_z (tz, <m); - - if (lt == (time_t) -1) - { - /* mktime returns -1 for errors, but -1 is also a - valid time_t value. Check whether an error really - occurred. */ - struct tm tm; - - if (! localtime_rz (tz, <, &tm) - || ((ltm.tm_sec ^ tm.tm_sec) - | (ltm.tm_min ^ tm.tm_min) - | (ltm.tm_hour ^ tm.tm_hour) - | (ltm.tm_mday ^ tm.tm_mday) - | (ltm.tm_mon ^ tm.tm_mon) - | (ltm.tm_year ^ tm.tm_year))) - break; - } - - if (! localtime_rz (0, <, >m)) + if (ltm.tm_wday < 0 || ! localtime_rz (0, <, >m)) break; - diff = tm_diff (<m, >m); } #endif diff --git a/gnu/obstack.c b/gnu/obstack.c index 31be3a76d0c07c037f056a619bdece40373e6a9d..abdd713d4fe1a6085895f08ec2458bba16a7b584 100644 --- a/gnu/obstack.c +++ b/gnu/obstack.c @@ -1,5 +1,5 @@ /* obstack.c - subroutines used implicitly by object stack macros - Copyright (C) 1988-2017 Free Software Foundation, Inc. + Copyright (C) 1988-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/gnu/obstack.h b/gnu/obstack.h index 00cd25dcbc1b45864048f4cfc2d7bb270716c471..9fc64552c0be94d66d709f3dfc9d29403184463c 100644 --- a/gnu/obstack.h +++ b/gnu/obstack.h @@ -1,5 +1,5 @@ /* obstack.h - object stack macros - Copyright (C) 1988-2017 Free Software Foundation, Inc. + Copyright (C) 1988-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -111,7 +111,7 @@ #include /* For size_t and ptrdiff_t. */ #include /* For __GNU_LIBRARY__, and memcpy. */ -#if __STDC_VERSION__ < 199901L +#if __STDC_VERSION__ < 199901L || defined __HP_cc # define __FLEXIBLE_ARRAY_MEMBER 1 #else # define __FLEXIBLE_ARRAY_MEMBER diff --git a/gnu/open-safer.c b/gnu/open-safer.c new file mode 100644 index 0000000000000000000000000000000000000000..040433a0dff3ad7eeb0d32cb52e6b237f3c99c74 --- /dev/null +++ b/gnu/open-safer.c @@ -0,0 +1,46 @@ +/* Invoke open, but avoid some glitches. + + Copyright (C) 2005-2006, 2008-2019 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 + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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 . */ + +/* Written by Paul Eggert. */ + +#include + +#include "fcntl-safer.h" + +#include +#include +#include "unistd-safer.h" + +int +open_safer (char const *file, int flags, ...) +{ + mode_t mode = 0; + + if (flags & O_CREAT) + { + va_list ap; + va_start (ap, flags); + + /* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4 + creates crashing code when 'mode_t' is smaller than 'int'. */ + mode = va_arg (ap, PROMOTED_MODE_T); + + va_end (ap); + } + + return fd_safer (open (file, flags, mode)); +} diff --git a/gnu/open.c b/gnu/open.c index b5452b56afd3a05d41e6179a535092eb8e16dc06..655260572d42cb6515add348c16a770b4f2d12af 100644 --- a/gnu/open.c +++ b/gnu/open.c @@ -1,5 +1,5 @@ /* Open a descriptor to a file. - Copyright (C) 2007-2017 Free Software Foundation, Inc. + Copyright (C) 2007-2019 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 @@ -86,7 +86,7 @@ open (const char *filename, int flags, ...) flags &= ~O_NONBLOCK; #endif -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ if (strcmp (filename, "/dev/null") == 0) filename = "NUL"; #endif diff --git a/gnu/openat-die.c b/gnu/openat-die.c index b45b6b91ec3151b66c5f7828e11546ef5d5db389..690c447af3646f587758db03c2ea0ec51b7c0380 100644 --- a/gnu/openat-die.c +++ b/gnu/openat-die.c @@ -1,6 +1,6 @@ /* Report a save- or restore-cwd failure in our openat replacement and then exit. - Copyright (C) 2005-2006, 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2019 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 diff --git a/gnu/openat-priv.h b/gnu/openat-priv.h index b5a411b944b047c3199237b1bb71d1f782f7e394..7b90eefa48813af797bea99bff7464704ebc4b94 100644 --- a/gnu/openat-priv.h +++ b/gnu/openat-priv.h @@ -1,6 +1,6 @@ /* Internals for openat-like functions. - Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2019 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 diff --git a/gnu/openat-proc.c b/gnu/openat-proc.c index 6d2b598c8b2878601c29efc750b98b5e28086f15..da76e2b393eb515feace001322ae6358c32a1a54 100644 --- a/gnu/openat-proc.c +++ b/gnu/openat-proc.c @@ -1,6 +1,6 @@ /* Create /proc/self/fd-related names for subfiles of open directories. - Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2019 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 diff --git a/gnu/openat-safer.c b/gnu/openat-safer.c new file mode 100644 index 0000000000000000000000000000000000000000..667beaaa829099785815a5c2183e569469d241c8 --- /dev/null +++ b/gnu/openat-safer.c @@ -0,0 +1,46 @@ +/* Invoke openat, but avoid some glitches. + + Copyright (C) 2005-2006, 2008-2019 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 + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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 . */ + +/* Written by Paul Eggert for open, ported by Eric Blake for openat. */ + +#include + +#include "fcntl-safer.h" + +#include +#include +#include "unistd-safer.h" + +int +openat_safer (int fd, char const *file, int flags, ...) +{ + mode_t mode = 0; + + if (flags & O_CREAT) + { + va_list ap; + va_start (ap, flags); + + /* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4 + creates crashing code when 'mode_t' is smaller than 'int'. */ + mode = va_arg (ap, PROMOTED_MODE_T); + + va_end (ap); + } + + return fd_safer (openat (fd, file, flags, mode)); +} diff --git a/gnu/openat.c b/gnu/openat.c index 8b6389e20661630313a535bc87c8e9ecc56b948a..4ab4a318d282f17173ea5d20348affb113a5ec99 100644 --- a/gnu/openat.c +++ b/gnu/openat.c @@ -1,5 +1,5 @@ /* provide a replacement openat function - Copyright (C) 2004-2017 Free Software Foundation, Inc. + Copyright (C) 2004-2019 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 diff --git a/gnu/openat.h b/gnu/openat.h index 1c4f64a32ed7fdb61d4f64a900b123eb34166cd1..f23b371c4375d79d9b38751e88d4482b6c529968 100644 --- a/gnu/openat.h +++ b/gnu/openat.h @@ -1,5 +1,5 @@ /* provide a replacement openat function - Copyright (C) 2004-2006, 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2004-2006, 2008-2019 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 diff --git a/gnu/opendir-safer.c b/gnu/opendir-safer.c index be18dc9108db1af5da7e3bd227c87833baee923d..0bd831a721700da2dd94863653091bb3826144aa 100644 --- a/gnu/opendir-safer.c +++ b/gnu/opendir-safer.c @@ -1,6 +1,6 @@ /* Invoke opendir, but avoid some glitches. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/opendir.c b/gnu/opendir.c index ad5c0d8348afbfacf740012d4285399b10679566..2eb96c6ec4838133d0d2a48d2115b58079e86964 100644 --- a/gnu/opendir.c +++ b/gnu/opendir.c @@ -1,5 +1,5 @@ /* Start reading the entries of a directory. - Copyright (C) 2006-2017 Free Software Foundation, Inc. + Copyright (C) 2006-2019 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 diff --git a/gnu/opendirat.c b/gnu/opendirat.c new file mode 100644 index 0000000000000000000000000000000000000000..ad63131ea115d31ffbc68c3cf9ee9a94908ef500 --- /dev/null +++ b/gnu/opendirat.c @@ -0,0 +1,54 @@ +/* Open a directory relative to another directory. + + Copyright 2006-2019 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 + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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 . + + Written by Jim Meyering and Paul Eggert. */ + +#include + +#include + +#include +#include +#include + +/* Relative to DIR_FD, open the directory DIR, passing EXTRA_FLAGS to + the underlying openat call. On success, store into *PNEW_FD the + underlying file descriptor of the newly opened directory and return + the directory stream. On failure, return NULL and set errno. + + On success, *PNEW_FD is at least 3, so this is a "safer" function. */ + +DIR * +opendirat (int dir_fd, char const *dir, int extra_flags, int *pnew_fd) +{ + int open_flags = (O_RDONLY | O_CLOEXEC | O_DIRECTORY | O_NOCTTY + | O_NONBLOCK | extra_flags); + int new_fd = openat (dir_fd, dir, open_flags); + + if (new_fd < 0) + return NULL; + DIR *dirp = fdopendir (new_fd); + if (dirp) + *pnew_fd = new_fd; + else + { + int fdopendir_errno = errno; + close (new_fd); + errno = fdopendir_errno; + } + return dirp; +} diff --git a/gnu/opendirat.h b/gnu/opendirat.h new file mode 100644 index 0000000000000000000000000000000000000000..1edf5b57d0da2236079552ebe54e19d48c573389 --- /dev/null +++ b/gnu/opendirat.h @@ -0,0 +1,2 @@ +#include +DIR *opendirat (int, char const *, int, int *); diff --git a/gnu/parse-datetime.c b/gnu/parse-datetime.c index 600ecf6372c6646282a642a38f43d54c70e08c43..568de6bea9aaab98375e6e729f19516c6a99c23a 100644 --- a/gnu/parse-datetime.c +++ b/gnu/parse-datetime.c @@ -67,7 +67,7 @@ /* Parse a string into an internal timestamp. - Copyright (C) 1999-2000, 2002-2017 Free Software Foundation, Inc. + Copyright (C) 1999-2000, 2002-2019 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 @@ -558,7 +558,7 @@ debug_print_current_time (char const *item, parser_control *pc) if (pc->local_zones_seen && !pc->debug_local_zones_seen) { fprintf (stderr, &" isdst=%d%s"[!space], - pc->local_isdst, pc->dsts_seen ? " DST" : ""); + pc->local_isdst, pc->dsts_seen ? " DST" : ""); pc->debug_local_zones_seen = true; space = true; } @@ -3456,24 +3456,17 @@ yyerror (parser_control const *pc _GL_UNUSED, return 0; } -/* In timezone TZ, if *TM0 is the old and *TM1 is the new value of a - struct tm after passing it to mktime_z, return true if it's OK that - mktime_z returned T. It's not OK if *TM0 has out-of-range - members. */ +/* If *TM0 is the old and *TM1 is the new value of a struct tm after + passing it to mktime_z, return true if it's OK. It's not OK if + mktime failed or if *TM0 has out-of-range mainline members. + The caller should set TM1->tm_wday to -1 before calling mktime, + as a negative tm_wday is how mktime failure is inferred. */ static bool -mktime_ok (timezone_t tz, struct tm const *tm0, struct tm const *tm1, time_t t) +mktime_ok (struct tm const *tm0, struct tm const *tm1) { - struct tm ltm; - if (t == (time_t) -1) - { - /* Guard against falsely reporting an error when parsing a - timestamp that happens to equal (time_t) -1, on a host that - supports such a timestamp. */ - tm1 = localtime_rz (tz, &t, <m); - if (!tm1) - return false; - } + if (tm1->tm_wday < 0) + return false; return ! ((tm0->tm_sec ^ tm1->tm_sec) | (tm0->tm_min ^ tm1->tm_min) @@ -3668,6 +3661,11 @@ parse_datetime2 (struct timespec *result, char const *p, timezone_t tz = tzdefault; + /* Store a local copy prior to first "goto". Without this, a prior use + below of RELATIVE_TIME_0 on the RHS might translate to an assignment- + to-temporary, which would trigger a -Wjump-misses-init warning. */ + const relative_time rel_time_0 = RELATIVE_TIME_0; + if (strncmp (p, "TZ=\"", 4) == 0) { char const *tzbase = p + 4; @@ -3740,7 +3738,7 @@ parse_datetime2 (struct timespec *result, char const *p, tm.tm_isdst = tmp.tm_isdst; pc.meridian = MER24; - pc.rel = RELATIVE_TIME_0; + pc.rel = rel_time_0; pc.timespec_seen = false; pc.rels_seen = false; pc.dates_seen = 0; @@ -3863,7 +3861,7 @@ parse_datetime2 (struct timespec *result, char const *p, fprintf (stderr, ", dst"); if (pc.zones_seen) - fprintf (stderr, " (%s)", time_zone_str (pc.time_zone, time_zone_buf)); + fprintf (stderr, " (%s)", time_zone_str (pc.time_zone, time_zone_buf)); fputc ('\n', stderr); } @@ -3943,10 +3941,11 @@ parse_datetime2 (struct timespec *result, char const *p, tm0.tm_mon = tm.tm_mon; tm0.tm_year = tm.tm_year; tm0.tm_isdst = tm.tm_isdst; + tm.tm_wday = -1; Start = mktime_z (tz, &tm); - if (! mktime_ok (tz, &tm0, &tm, Start)) + if (! mktime_ok (&tm0, &tm)) { bool repaired = false; bool time_zone_seen = pc.zones_seen != 0; @@ -3979,8 +3978,9 @@ parse_datetime2 (struct timespec *result, char const *p, tm.tm_mon = tm0.tm_mon; tm.tm_year = tm0.tm_year; tm.tm_isdst = tm0.tm_isdst; + tm.tm_wday = -1; Start = mktime_z (tz2, &tm); - repaired = mktime_ok (tz2, &tm0, &tm, Start); + repaired = mktime_ok (&tm0, &tm); tzfree (tz2); } diff --git a/gnu/parse-datetime.h b/gnu/parse-datetime.h index 013be4b16c870e8ae55cc58c9e22b75b53e8cf72..9f7aebd1d692b87e8c1b618308fadec51a227a4a 100644 --- a/gnu/parse-datetime.h +++ b/gnu/parse-datetime.h @@ -1,6 +1,6 @@ /* Parse a string into an internal timestamp. - Copyright (C) 1995, 1997-1998, 2003-2004, 2007, 2009-2017 Free Software + Copyright (C) 1995, 1997-1998, 2003-2004, 2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/parse-datetime.y b/gnu/parse-datetime.y index f8da02d3f3fdbe3dfb1fc3c46bf897c72971fa1c..b264bb7fbbd4ecac46b45d41024cd72686c57ad2 100644 --- a/gnu/parse-datetime.y +++ b/gnu/parse-datetime.y @@ -1,7 +1,7 @@ %{ /* Parse a string into an internal timestamp. - Copyright (C) 1999-2000, 2002-2017 Free Software Foundation, Inc. + Copyright (C) 1999-2000, 2002-2019 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 @@ -492,7 +492,7 @@ debug_print_current_time (char const *item, parser_control *pc) if (pc->local_zones_seen && !pc->debug_local_zones_seen) { fprintf (stderr, &" isdst=%d%s"[!space], - pc->local_isdst, pc->dsts_seen ? " DST" : ""); + pc->local_isdst, pc->dsts_seen ? " DST" : ""); pc->debug_local_zones_seen = true; space = true; } @@ -1554,24 +1554,17 @@ yyerror (parser_control const *pc _GL_UNUSED, return 0; } -/* In timezone TZ, if *TM0 is the old and *TM1 is the new value of a - struct tm after passing it to mktime_z, return true if it's OK that - mktime_z returned T. It's not OK if *TM0 has out-of-range - members. */ +/* If *TM0 is the old and *TM1 is the new value of a struct tm after + passing it to mktime_z, return true if it's OK. It's not OK if + mktime failed or if *TM0 has out-of-range mainline members. + The caller should set TM1->tm_wday to -1 before calling mktime, + as a negative tm_wday is how mktime failure is inferred. */ static bool -mktime_ok (timezone_t tz, struct tm const *tm0, struct tm const *tm1, time_t t) +mktime_ok (struct tm const *tm0, struct tm const *tm1) { - struct tm ltm; - if (t == (time_t) -1) - { - /* Guard against falsely reporting an error when parsing a - timestamp that happens to equal (time_t) -1, on a host that - supports such a timestamp. */ - tm1 = localtime_rz (tz, &t, <m); - if (!tm1) - return false; - } + if (tm1->tm_wday < 0) + return false; return ! ((tm0->tm_sec ^ tm1->tm_sec) | (tm0->tm_min ^ tm1->tm_min) @@ -1766,6 +1759,11 @@ parse_datetime2 (struct timespec *result, char const *p, timezone_t tz = tzdefault; + /* Store a local copy prior to first "goto". Without this, a prior use + below of RELATIVE_TIME_0 on the RHS might translate to an assignment- + to-temporary, which would trigger a -Wjump-misses-init warning. */ + const relative_time rel_time_0 = RELATIVE_TIME_0; + if (strncmp (p, "TZ=\"", 4) == 0) { char const *tzbase = p + 4; @@ -1838,7 +1836,7 @@ parse_datetime2 (struct timespec *result, char const *p, tm.tm_isdst = tmp.tm_isdst; pc.meridian = MER24; - pc.rel = RELATIVE_TIME_0; + pc.rel = rel_time_0; pc.timespec_seen = false; pc.rels_seen = false; pc.dates_seen = 0; @@ -1961,7 +1959,7 @@ parse_datetime2 (struct timespec *result, char const *p, fprintf (stderr, ", dst"); if (pc.zones_seen) - fprintf (stderr, " (%s)", time_zone_str (pc.time_zone, time_zone_buf)); + fprintf (stderr, " (%s)", time_zone_str (pc.time_zone, time_zone_buf)); fputc ('\n', stderr); } @@ -2041,10 +2039,11 @@ parse_datetime2 (struct timespec *result, char const *p, tm0.tm_mon = tm.tm_mon; tm0.tm_year = tm.tm_year; tm0.tm_isdst = tm.tm_isdst; + tm.tm_wday = -1; Start = mktime_z (tz, &tm); - if (! mktime_ok (tz, &tm0, &tm, Start)) + if (! mktime_ok (&tm0, &tm)) { bool repaired = false; bool time_zone_seen = pc.zones_seen != 0; @@ -2077,8 +2076,9 @@ parse_datetime2 (struct timespec *result, char const *p, tm.tm_mon = tm0.tm_mon; tm.tm_year = tm0.tm_year; tm.tm_isdst = tm0.tm_isdst; + tm.tm_wday = -1; Start = mktime_z (tz2, &tm); - repaired = mktime_ok (tz2, &tm0, &tm, Start); + repaired = mktime_ok (&tm0, &tm); tzfree (tz2); } diff --git a/gnu/pathmax.h b/gnu/pathmax.h index 191ba45e6933f68f09d7d75c971deedb1a84db0f..83b9491f1154aecca7b230460114f952aeac6f33 100644 --- a/gnu/pathmax.h +++ b/gnu/pathmax.h @@ -1,5 +1,5 @@ /* Define PATH_MAX somehow. Requires sys/types.h. - Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2017 Free Software + Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -65,7 +65,7 @@ # define PATH_MAX 1024 # endif -# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# if defined _WIN32 && ! defined __CYGWIN__ /* The page "Naming Files, Paths, and Namespaces" on msdn.microsoft.com, section "Maximum Path Length Limitation", diff --git a/gnu/pipe-safer.c b/gnu/pipe-safer.c index a3cfc10e89ca5f68413de6012c65314dbc03eefd..62017397c60e42bc94a0d15d0b09ddf8e47701e3 100644 --- a/gnu/pipe-safer.c +++ b/gnu/pipe-safer.c @@ -1,5 +1,5 @@ /* Invoke pipe, but avoid some glitches. - Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2019 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 diff --git a/gnu/printf-args.c b/gnu/printf-args.c index 74335e494384823fcfa4095b5ef75c66a7e8453e..e45cfbede10ed3913850a3c66b2eb8ada5a9624c 100644 --- a/gnu/printf-args.c +++ b/gnu/printf-args.c @@ -1,5 +1,5 @@ /* Decomposed printf argument list. - Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2017 Free Software + Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/gnu/printf-args.h b/gnu/printf-args.h index 74fd26e9a7bc4a34ec186f0f770f995fb0cad8cd..866cba04d8ca45c284c44c4ea5dfc0cdbf9c4bf8 100644 --- a/gnu/printf-args.h +++ b/gnu/printf-args.h @@ -1,5 +1,5 @@ /* Decomposed printf argument list. - Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2017 Free Software + Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/gnu/printf-parse.c b/gnu/printf-parse.c index b56eb7245571e7478bc188a3d6af252176540fa0..8596fd5f305c544215863409355ca60790f25d8d 100644 --- a/gnu/printf-parse.c +++ b/gnu/printf-parse.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 1999-2000, 2002-2003, 2006-2017 Free Software Foundation, Inc. + Copyright (C) 1999-2000, 2002-2003, 2006-2019 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 @@ -419,7 +419,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) cp++; } #endif -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ /* On native Windows, PRIdMAX is defined as "I64d". We cannot change it to "lld" because PRIdMAX must also be understood by the system's printf routines. */ diff --git a/gnu/printf-parse.h b/gnu/printf-parse.h index e19a07dc0fdd828ca1b529990063acbae79aede5..746bb3fe0fa9f23e439b7a677c43ec37222c360b 100644 --- a/gnu/printf-parse.h +++ b/gnu/printf-parse.h @@ -1,5 +1,5 @@ /* Parse printf format string. - Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2017 Free Software + Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2019 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff --git a/gnu/priv-set.c b/gnu/priv-set.c index 1ba2551d2daa73c60d1881c77a39c41e101be4e5..2e4ce40fdde8690715fa9efe84c55e19f1d40c05 100644 --- a/gnu/priv-set.c +++ b/gnu/priv-set.c @@ -1,6 +1,6 @@ /* Query, remove, or restore a Solaris privilege. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/priv-set.h b/gnu/priv-set.h index 22463e5df570911f7be9ab995e2d8fe0bf403305..96f6428fb271d184f25bb2d9703f5dda55dd9896 100644 --- a/gnu/priv-set.h +++ b/gnu/priv-set.h @@ -1,6 +1,6 @@ /* Query, remove, or restore a Solaris privilege. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/progname.c b/gnu/progname.c index fa51ca9c1422038c1fceed46e9bc25fef1495be1..a42b7fa2f7003c13ef1434c308d2492a6af874a6 100644 --- a/gnu/progname.c +++ b/gnu/progname.c @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2001-2003, 2005-2017 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify diff --git a/gnu/progname.h b/gnu/progname.h index 3e026246c6663a15e5c2166f876622578b8e919f..c726e97e905e54535d7c63ebd15d0026c44e8fa6 100644 --- a/gnu/progname.h +++ b/gnu/progname.h @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2001-2004, 2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2006, 2009-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify diff --git a/gnu/quote.h b/gnu/quote.h index 2c2f0b747974a2c23de2a745dd9f8942ddff05f4..5cef8ff1e0937ed37a4d2f2956ec8f2667b38898 100644 --- a/gnu/quote.h +++ b/gnu/quote.h @@ -1,6 +1,6 @@ /* quote.h - prototypes for quote.c - Copyright (C) 1998-2001, 2003, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 1998-2001, 2003, 2009-2019 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 diff --git a/gnu/quotearg.c b/gnu/quotearg.c index 8e432e1343c1a6893408bb403a4b7c901357b048..773d53f11549b81a33d650085ed2642c0e200795 100644 --- a/gnu/quotearg.c +++ b/gnu/quotearg.c @@ -1,6 +1,6 @@ /* quotearg.c - quote arguments for output - Copyright (C) 1998-2002, 2004-2017 Free Software Foundation, Inc. + Copyright (C) 1998-2002, 2004-2019 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 @@ -1080,3 +1080,10 @@ quote (char const *arg) { return quote_n (0, arg); } + +/* + * Hey Emacs! + * Local Variables: + * coding: utf-8 + * End: + */ diff --git a/gnu/quotearg.h b/gnu/quotearg.h index 8d6b7f887a5497283f7fa7bc843f0bd5c84cebb8..0f07e0211e29ba8d15a0623ca6844a21f3d060ca 100644 --- a/gnu/quotearg.h +++ b/gnu/quotearg.h @@ -1,6 +1,6 @@ /* quotearg.h - quote arguments for output - Copyright (C) 1998-2002, 2004, 2006, 2008-2017 Free Software Foundation, + Copyright (C) 1998-2002, 2004, 2006, 2008-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/raise.c b/gnu/raise.c index aff5a582a6772dcd342f7d343aa74f40c45087d9..e750b7a4c6495914e6266b1dbc171a3cbfa2551b 100644 --- a/gnu/raise.c +++ b/gnu/raise.c @@ -1,6 +1,6 @@ /* Provide a non-threads replacement for the POSIX raise function. - Copyright (C) 2002-2003, 2005-2006, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2006, 2009-2019 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 @@ -31,27 +31,9 @@ # include "msvc-inval.h" # endif -# undef raise - # if HAVE_MSVC_INVALID_PARAMETER_HANDLER -static int -raise_nothrow (int sig) -{ - int result; - - TRY_MSVC_INVAL - { - result = raise (sig); - } - CATCH_MSVC_INVAL - { - result = -1; - errno = EINVAL; - } - DONE_MSVC_INVAL; - - return result; -} +/* Forward declaration. */ +static int raise_nothrow (int sig); # else # define raise_nothrow raise # endif @@ -61,12 +43,11 @@ raise_nothrow (int sig) # include -# define rpl_raise raise - #endif int -rpl_raise (int sig) +raise (int sig) +#undef raise { #if GNULIB_defined_signal_blocking && GNULIB_defined_SIGPIPE if (sig == SIGPIPE) @@ -79,3 +60,24 @@ rpl_raise (int sig) return kill (getpid (), sig); #endif } + +#if HAVE_RAISE && HAVE_MSVC_INVALID_PARAMETER_HANDLER +static int +raise_nothrow (int sig) +{ + int result; + + TRY_MSVC_INVAL + { + result = raise (sig); + } + CATCH_MSVC_INVAL + { + result = -1; + errno = EINVAL; + } + DONE_MSVC_INVAL; + + return result; +} +#endif diff --git a/gnu/rawmemchr.c b/gnu/rawmemchr.c index f5793dd6603479999f3cfe7f919fc896f389448b..7df61512fc6345ebd7d9347b122c1aee83748f67 100644 --- a/gnu/rawmemchr.c +++ b/gnu/rawmemchr.c @@ -1,5 +1,5 @@ /* Searching in a string. - Copyright (C) 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2008-2019 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 diff --git a/gnu/read.c b/gnu/read.c index 238e765a4755af5914f6575c5cd1641d3186ef56..52df1b06eb05b2d9f9ae7c3beab870c43767de19 100644 --- a/gnu/read.c +++ b/gnu/read.c @@ -1,5 +1,5 @@ /* POSIX compatible read() function. - Copyright (C) 2008-2017 Free Software Foundation, Inc. + Copyright (C) 2008-2019 Free Software Foundation, Inc. Written by Bruno Haible , 2011. This program is free software: you can redistribute it and/or modify @@ -20,7 +20,7 @@ /* Specification. */ #include -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +#if defined _WIN32 && ! defined __CYGWIN__ # include # include diff --git a/gnu/readdir.c b/gnu/readdir.c index 041cdbdf799c50ef152809597c6eb22a168674c1..2a2e1e319503c4bd53a31bba5e725c7d19bb2db7 100644 --- a/gnu/readdir.c +++ b/gnu/readdir.c @@ -1,5 +1,5 @@ /* Read the next entry of a directory. - Copyright (C) 2011-2017 Free Software Foundation, Inc. + Copyright (C) 2011-2019 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 diff --git a/gnu/readlink.c b/gnu/readlink.c index cd9604b224cad616e73ea5d38fcbe8ce604781bd..bf71109350215c965fc039de94e8e63c301d0fe9 100644 --- a/gnu/readlink.c +++ b/gnu/readlink.c @@ -1,5 +1,5 @@ /* Stub for readlink(). - Copyright (C) 2003-2007, 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2003-2007, 2009-2019 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 diff --git a/gnu/readlinkat.c b/gnu/readlinkat.c index c9880e1c7049b3464535fd75273e44b57e3e85f3..c0f3e59f6ce2161da2a91d89b3c268bcbae340b6 100644 --- a/gnu/readlinkat.c +++ b/gnu/readlinkat.c @@ -1,5 +1,5 @@ /* Read a symlink relative to an open directory. - Copyright (C) 2009-2017 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 diff --git a/gnu/realloc.c b/gnu/realloc.c index 4a7d390e90e0004783641c536578e4ccd14b73ba..a81ce3b55dcd54b8370fbf4aefd1ab22526e9f94 100644 --- a/gnu/realloc.c +++ b/gnu/realloc.c @@ -1,6 +1,6 @@ /* realloc() function that is glibc compatible. - Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2017 Free Software + Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff --git a/gnu/ref-add.sin b/gnu/ref-add.sin deleted file mode 100644 index 52df06a22bfd7da8f99cb7c0b1bd2d5c6a9bd5f5..0000000000000000000000000000000000000000 --- a/gnu/ref-add.sin +++ /dev/null @@ -1,29 +0,0 @@ -# Add this package to a list of references stored in a text file. -# -# Copyright (C) 2000, 2009-2017 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 -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# 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 . -# -# Written by Bruno Haible . -# -/^# Packages using this file: / { - s/# Packages using this file:// - ta - :a - s/ @PACKAGE@ / @PACKAGE@ / - tb - s/ $/ @PACKAGE@ / - :b - s/^/# Packages using this file:/ -} diff --git a/gnu/ref-del.sin b/gnu/ref-del.sin deleted file mode 100644 index 8e9752d23c6efb97b8aca3d9bf0144e35225d419..0000000000000000000000000000000000000000 --- a/gnu/ref-del.sin +++ /dev/null @@ -1,24 +0,0 @@ -# Remove this package from a list of references stored in a text file. -# -# Copyright (C) 2000, 2009-2017 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 -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# 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 . -# -# Written by Bruno Haible . -# -/^# Packages using this file: / { - s/# Packages using this file:// - s/ @PACKAGE@ / / - s/^/# Packages using this file:/ -} diff --git a/gnu/regcomp.c b/gnu/regcomp.c index d79c69d6ad6efdf996732544c43f5c79a0d10b0d..10a0a49d97a947a1442ea6e807719127ebea5a79 100644 --- a/gnu/regcomp.c +++ b/gnu/regcomp.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -59,7 +59,7 @@ static reg_errcode_t calc_inveclosure (re_dfa_t *dfa); static Idx fetch_number (re_string_t *input, re_token_t *token, reg_syntax_t syntax); static int peek_token (re_token_t *token, re_string_t *input, - reg_syntax_t syntax) internal_function; + reg_syntax_t syntax); static bin_tree_t *parse (re_string_t *regexp, regex_t *preg, reg_syntax_t syntax, reg_errcode_t *err); static bin_tree_t *parse_reg_exp (re_string_t *regexp, regex_t *preg, @@ -233,9 +233,7 @@ re_compile_pattern (const char *pattern, size_t length, return NULL; return gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]); } -#ifdef _LIBC weak_alias (__re_compile_pattern, re_compile_pattern) -#endif /* Set by 're_set_syntax' to the current regexp syntax to recognize. Can also be assigned to arbitrarily: each pattern buffer stores its own @@ -260,9 +258,7 @@ re_set_syntax (reg_syntax_t syntax) re_syntax_options = syntax; return ret; } -#ifdef _LIBC weak_alias (__re_set_syntax, re_set_syntax) -#endif int re_compile_fastmap (struct re_pattern_buffer *bufp) @@ -281,9 +277,7 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) bufp->fastmap_accurate = 1; return 0; } -#ifdef _LIBC weak_alias (__re_compile_fastmap, re_compile_fastmap) -#endif static inline void __attribute__ ((always_inline)) @@ -464,7 +458,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, the return codes and their meanings.) */ int -regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags) +regcomp (regex_t *__restrict preg, const char *__restrict pattern, int cflags) { reg_errcode_t ret; reg_syntax_t syntax = ((cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED @@ -476,7 +470,7 @@ regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags) /* Try to allocate space for the fastmap. */ preg->fastmap = re_malloc (char, SBC_MAX); - if (BE (preg->fastmap == NULL, 0)) + if (__glibc_unlikely (preg->fastmap == NULL)) return REG_ESPACE; syntax |= (cflags & REG_ICASE) ? RE_ICASE : 0; @@ -502,7 +496,7 @@ regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags) ret = REG_EPAREN; /* We have already checked preg->fastmap != NULL. */ - if (BE (ret == REG_NOERROR, 1)) + if (__glibc_likely (ret == REG_NOERROR)) /* Compute the fastmap now, since regexec cannot modify the pattern buffer. This function never fails in this implementation. */ (void) re_compile_fastmap (preg); @@ -515,23 +509,21 @@ regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags) return (int) ret; } -#ifdef _LIBC +libc_hidden_def (__regcomp) weak_alias (__regcomp, regcomp) -#endif /* Returns a message corresponding to an error code, ERRCODE, returned from either regcomp or regexec. We don't use PREG here. */ size_t -regerror (int errcode, const regex_t *_Restrict_ preg, char *_Restrict_ errbuf, +regerror (int errcode, const regex_t *__restrict preg, char *__restrict errbuf, size_t errbuf_size) { const char *msg; size_t msg_size; + int nerrcodes = sizeof __re_error_msgid_idx / sizeof __re_error_msgid_idx[0]; - if (BE (errcode < 0 - || errcode >= (int) (sizeof (__re_error_msgid_idx) - / sizeof (__re_error_msgid_idx[0])), 0)) + if (__glibc_unlikely (errcode < 0 || errcode >= nerrcodes)) /* Only error codes returned by the rest of the code should be passed to this routine. If we are given anything else, or if other regex code generates an invalid error code, then the program has a bug. @@ -542,10 +534,10 @@ regerror (int errcode, const regex_t *_Restrict_ preg, char *_Restrict_ errbuf, msg_size = strlen (msg) + 1; /* Includes the null. */ - if (BE (errbuf_size != 0, 1)) + if (__glibc_likely (errbuf_size != 0)) { size_t cpy_size = msg_size; - if (BE (msg_size > errbuf_size, 0)) + if (__glibc_unlikely (msg_size > errbuf_size)) { cpy_size = errbuf_size - 1; errbuf[cpy_size] = '\0'; @@ -555,9 +547,7 @@ regerror (int errcode, const regex_t *_Restrict_ preg, char *_Restrict_ errbuf, return msg_size; } -#ifdef _LIBC weak_alias (__regerror, regerror) -#endif #ifdef RE_ENABLE_I18N @@ -643,7 +633,7 @@ void regfree (regex_t *preg) { re_dfa_t *dfa = preg->buffer; - if (BE (dfa != NULL, 1)) + if (__glibc_likely (dfa != NULL)) { lock_fini (dfa->lock); free_dfa_content (dfa); @@ -657,9 +647,8 @@ regfree (regex_t *preg) re_free (preg->translate); preg->translate = NULL; } -#ifdef _LIBC +libc_hidden_def (__regfree) weak_alias (__regfree, regfree) -#endif /* Entry points compatible with 4.2 BSD regex library. We don't define them unless specifically requested. */ @@ -699,7 +688,7 @@ re_comp (const char *s) if (re_comp_buf.fastmap == NULL) { - re_comp_buf.fastmap = (char *) malloc (SBC_MAX); + re_comp_buf.fastmap = re_malloc (char, SBC_MAX); if (re_comp_buf.fastmap == NULL) return (char *) gettext (__re_error_msgid + __re_error_msgid_idx[(int) REG_ESPACE]); @@ -752,7 +741,7 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length, /* Initialize the dfa. */ dfa = preg->buffer; - if (BE (preg->allocated < sizeof (re_dfa_t), 0)) + if (__glibc_unlikely (preg->allocated < sizeof (re_dfa_t))) { /* If zero allocated, but buffer is non-null, try to realloc enough space. This loses if buffer's address is bogus, but @@ -767,9 +756,9 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length, preg->used = sizeof (re_dfa_t); err = init_dfa (dfa, length); - if (BE (err == REG_NOERROR && lock_init (dfa->lock) != 0, 0)) + if (__glibc_unlikely (err == REG_NOERROR && lock_init (dfa->lock) != 0)) err = REG_ESPACE; - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) { free_dfa_content (dfa); preg->buffer = NULL; @@ -784,7 +773,7 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length, err = re_string_construct (®exp, pattern, length, preg->translate, (syntax & RE_ICASE) != 0, dfa); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) { re_compile_internal_free_return: free_workarea_compile (preg); @@ -799,12 +788,12 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length, /* Parse the regular expression, and build a structure tree. */ preg->re_nsub = 0; dfa->str_tree = parse (®exp, preg, syntax, &err); - if (BE (dfa->str_tree == NULL, 0)) + if (__glibc_unlikely (dfa->str_tree == NULL)) goto re_compile_internal_free_return; /* Analyze the tree and create the nfa. */ err = analyze (preg); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) goto re_compile_internal_free_return; #ifdef RE_ENABLE_I18N @@ -820,7 +809,7 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length, free_workarea_compile (preg); re_string_destruct (®exp); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) { lock_fini (dfa->lock); free_dfa_content (dfa); @@ -862,7 +851,8 @@ init_dfa (re_dfa_t *dfa, size_t pat_len) calculation below, and for similar doubling calculations elsewhere. And it's <= rather than <, because some of the doubling calculations add 1 afterwards. */ - if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) / 2 <= pat_len, 0)) + if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / max_object_size) / 2 + <= pat_len)) return REG_ESPACE; dfa->nodes_alloc = pat_len + 1; @@ -906,7 +896,7 @@ init_dfa (re_dfa_t *dfa, size_t pat_len) int i, j, ch; dfa->sb_char = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1); - if (BE (dfa->sb_char == NULL, 0)) + if (__glibc_unlikely (dfa->sb_char == NULL)) return REG_ESPACE; /* Set the bits corresponding to single byte chars. */ @@ -925,7 +915,7 @@ init_dfa (re_dfa_t *dfa, size_t pat_len) } #endif - if (BE (dfa->nodes == NULL || dfa->state_table == NULL, 0)) + if (__glibc_unlikely (dfa->nodes == NULL || dfa->state_table == NULL)) return REG_ESPACE; return REG_NOERROR; } @@ -935,21 +925,23 @@ init_dfa (re_dfa_t *dfa, size_t pat_len) character used by some operators like "\<", "\>", etc. */ static void -internal_function init_word_char (re_dfa_t *dfa) { int i = 0; int j; int ch = 0; dfa->word_ops_used = 1; - if (BE (dfa->map_notascii == 0, 1)) + if (__glibc_likely (dfa->map_notascii == 0)) { + /* Avoid uint32_t and uint64_t as some non-GCC platforms lack + them, an issue when this code is used in Gnulib. */ bitset_word_t bits0 = 0x00000000; bitset_word_t bits1 = 0x03ff0000; bitset_word_t bits2 = 0x87fffffe; bitset_word_t bits3 = 0x07fffffe; if (BITSET_WORD_BITS == 64) { + /* Pacify gcc -Woverflow on 32-bit platformns. */ dfa->word_char[0] = bits1 << 31 << 1 | bits0; dfa->word_char[1] = bits3 << 31 << 1 | bits2; i = 2; @@ -966,7 +958,7 @@ init_word_char (re_dfa_t *dfa) goto general_case; ch = 128; - if (BE (dfa->is_utf8, 1)) + if (__glibc_likely (dfa->is_utf8)) { memset (&dfa->word_char[i], '\0', (SBC_MAX - ch) / 8); return; @@ -1013,7 +1005,7 @@ create_initial_state (re_dfa_t *dfa) first = dfa->str_tree->first->node_idx; dfa->init_node = first; err = re_node_set_init_copy (&init_nodes, dfa->eclosures + first); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) return err; /* The back-references which are in initial states can epsilon transit, @@ -1057,7 +1049,7 @@ create_initial_state (re_dfa_t *dfa) /* It must be the first time to invoke acquire_state. */ dfa->init_state = re_acquire_state_context (&err, dfa, &init_nodes, 0); /* We don't check ERR here, since the initial state must not be NULL. */ - if (BE (dfa->init_state == NULL, 0)) + if (__glibc_unlikely (dfa->init_state == NULL)) return err; if (dfa->init_state->has_constraint) { @@ -1069,8 +1061,9 @@ create_initial_state (re_dfa_t *dfa) &init_nodes, CONTEXT_NEWLINE | CONTEXT_BEGBUF); - if (BE (dfa->init_state_word == NULL || dfa->init_state_nl == NULL - || dfa->init_state_begbuf == NULL, 0)) + if (__glibc_unlikely (dfa->init_state_word == NULL + || dfa->init_state_nl == NULL + || dfa->init_state_begbuf == NULL)) return err; } else @@ -1177,8 +1170,8 @@ analyze (regex_t *preg) dfa->org_indices = re_malloc (Idx, dfa->nodes_alloc); dfa->edests = re_malloc (re_node_set, dfa->nodes_alloc); dfa->eclosures = re_malloc (re_node_set, dfa->nodes_alloc); - if (BE (dfa->nexts == NULL || dfa->org_indices == NULL || dfa->edests == NULL - || dfa->eclosures == NULL, 0)) + if (__glibc_unlikely (dfa->nexts == NULL || dfa->org_indices == NULL + || dfa->edests == NULL || dfa->eclosures == NULL)) return REG_ESPACE; dfa->subexp_map = re_malloc (Idx, preg->re_nsub); @@ -1193,23 +1186,23 @@ analyze (regex_t *preg) break; if (i == preg->re_nsub) { - free (dfa->subexp_map); + re_free (dfa->subexp_map); dfa->subexp_map = NULL; } } ret = postorder (dfa->str_tree, lower_subexps, preg); - if (BE (ret != REG_NOERROR, 0)) + if (__glibc_unlikely (ret != REG_NOERROR)) return ret; ret = postorder (dfa->str_tree, calc_first, dfa); - if (BE (ret != REG_NOERROR, 0)) + if (__glibc_unlikely (ret != REG_NOERROR)) return ret; preorder (dfa->str_tree, calc_next, dfa); ret = preorder (dfa->str_tree, link_nfa_nodes, dfa); - if (BE (ret != REG_NOERROR, 0)) + if (__glibc_unlikely (ret != REG_NOERROR)) return ret; ret = calc_eclosure (dfa); - if (BE (ret != REG_NOERROR, 0)) + if (__glibc_unlikely (ret != REG_NOERROR)) return ret; /* We only need this during the prune_impossible_nodes pass in regexec.c; @@ -1218,7 +1211,7 @@ analyze (regex_t *preg) || dfa->nbackref) { dfa->inveclosures = re_malloc (re_node_set, dfa->nodes_len); - if (BE (dfa->inveclosures == NULL, 0)) + if (__glibc_unlikely (dfa->inveclosures == NULL)) return REG_ESPACE; ret = calc_inveclosure (dfa); } @@ -1248,7 +1241,7 @@ postorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)), do { reg_errcode_t err = fn (extra, node); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) return err; if (node->parent == NULL) return REG_NOERROR; @@ -1270,7 +1263,7 @@ preorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)), for (node = root; ; ) { reg_errcode_t err = fn (extra, node); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) return err; /* Go to the left node, or up and to the right. */ @@ -1371,7 +1364,8 @@ lower_subexp (reg_errcode_t *err, regex_t *preg, bin_tree_t *node) cls = create_tree (dfa, NULL, NULL, OP_CLOSE_SUBEXP); tree1 = body ? create_tree (dfa, body, cls, CONCAT) : cls; tree = create_tree (dfa, op, tree1, CONCAT); - if (BE (tree == NULL || tree1 == NULL || op == NULL || cls == NULL, 0)) + if (__glibc_unlikely (tree == NULL || tree1 == NULL + || op == NULL || cls == NULL)) { *err = REG_ESPACE; return NULL; @@ -1397,7 +1391,7 @@ calc_first (void *extra, bin_tree_t *node) { node->first = node; node->node_idx = re_dfa_add_node (dfa, node->token); - if (BE (node->node_idx == -1, 0)) + if (__glibc_unlikely (node->node_idx == -1)) return REG_ESPACE; if (node->token.type == ANCHOR) dfa->nodes[node->node_idx].constraint = node->token.opr.ctx_type; @@ -1490,7 +1484,6 @@ link_nfa_nodes (void *extra, bin_tree_t *node) to their own constraint. */ static reg_errcode_t -internal_function duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node, Idx root_node, unsigned int init_constraint) { @@ -1509,11 +1502,11 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node, org_dest = dfa->nexts[org_node]; re_node_set_empty (dfa->edests + clone_node); clone_dest = duplicate_node (dfa, org_dest, constraint); - if (BE (clone_dest == -1, 0)) + if (__glibc_unlikely (clone_dest == -1)) return REG_ESPACE; dfa->nexts[clone_node] = dfa->nexts[org_node]; ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); - if (BE (! ok, 0)) + if (__glibc_unlikely (! ok)) return REG_ESPACE; } else if (dfa->edests[org_node].nelem == 0) @@ -1535,17 +1528,17 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node, if (org_node == root_node && clone_node != org_node) { ok = re_node_set_insert (dfa->edests + clone_node, org_dest); - if (BE (! ok, 0)) + if (__glibc_unlikely (! ok)) return REG_ESPACE; break; } /* In case the node has another constraint, append it. */ constraint |= dfa->nodes[org_node].constraint; clone_dest = duplicate_node (dfa, org_dest, constraint); - if (BE (clone_dest == -1, 0)) + if (__glibc_unlikely (clone_dest == -1)) return REG_ESPACE; ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); - if (BE (! ok, 0)) + if (__glibc_unlikely (! ok)) return REG_ESPACE; } else /* dfa->edests[org_node].nelem == 2 */ @@ -1561,14 +1554,14 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node, /* There is no such duplicated node, create a new one. */ reg_errcode_t err; clone_dest = duplicate_node (dfa, org_dest, constraint); - if (BE (clone_dest == -1, 0)) + if (__glibc_unlikely (clone_dest == -1)) return REG_ESPACE; ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); - if (BE (! ok, 0)) + if (__glibc_unlikely (! ok)) return REG_ESPACE; err = duplicate_node_closure (dfa, org_dest, clone_dest, root_node, constraint); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) return err; } else @@ -1576,16 +1569,16 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node, /* There is a duplicated node which satisfies the constraint, use it to avoid infinite loop. */ ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); - if (BE (! ok, 0)) + if (__glibc_unlikely (! ok)) return REG_ESPACE; } org_dest = dfa->edests[org_node].elems[1]; clone_dest = duplicate_node (dfa, org_dest, constraint); - if (BE (clone_dest == -1, 0)) + if (__glibc_unlikely (clone_dest == -1)) return REG_ESPACE; ok = re_node_set_insert (dfa->edests + clone_node, clone_dest); - if (BE (! ok, 0)) + if (__glibc_unlikely (! ok)) return REG_ESPACE; } org_node = org_dest; @@ -1619,7 +1612,7 @@ static Idx duplicate_node (re_dfa_t *dfa, Idx org_idx, unsigned int constraint) { Idx dup_idx = re_dfa_add_node (dfa, dfa->nodes[org_idx]); - if (BE (dup_idx != -1, 1)) + if (__glibc_likely (dup_idx != -1)) { dfa->nodes[dup_idx].constraint = constraint; dfa->nodes[dup_idx].constraint |= dfa->nodes[org_idx].constraint; @@ -1645,7 +1638,7 @@ calc_inveclosure (re_dfa_t *dfa) for (idx = 0; idx < dfa->eclosures[src].nelem; ++idx) { ok = re_node_set_insert_last (dfa->inveclosures + elems[idx], src); - if (BE (! ok, 0)) + if (__glibc_unlikely (! ok)) return REG_ESPACE; } } @@ -1686,7 +1679,7 @@ calc_eclosure (re_dfa_t *dfa) continue; /* Calculate epsilon closure of 'node_idx'. */ err = calc_eclosure_iter (&eclosure_elem, dfa, node_idx, true); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) return err; if (dfa->eclosures[node_idx].nelem == 0) @@ -1709,7 +1702,7 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root) bool ok; bool incomplete = false; err = re_node_set_alloc (&eclosure, dfa->edests[node].nelem + 1); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) return err; /* This indicates that we are calculating this node now. @@ -1724,7 +1717,7 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root) { err = duplicate_node_closure (dfa, node, node, node, dfa->nodes[node].constraint); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) return err; } @@ -1746,14 +1739,14 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root) if (dfa->eclosures[edest].nelem == 0) { err = calc_eclosure_iter (&eclosure_elem, dfa, edest, false); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) return err; } else eclosure_elem = dfa->eclosures[edest]; /* Merge the epsilon closure of 'edest'. */ err = re_node_set_merge (&eclosure, &eclosure_elem); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) return err; /* If the epsilon closure of 'edest' is incomplete, the epsilon closure of this node is also incomplete. */ @@ -1766,7 +1759,7 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root) /* An epsilon closure includes itself. */ ok = re_node_set_insert (&eclosure, node); - if (BE (! ok, 0)) + if (__glibc_unlikely (! ok)) return REG_ESPACE; if (incomplete && !root) dfa->eclosures[node].nelem = 0; @@ -1782,7 +1775,6 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root) We must not use this function inside bracket expressions. */ static void -internal_function fetch_token (re_token_t *result, re_string_t *input, reg_syntax_t syntax) { re_string_skip_bytes (input, peek_token (result, input, syntax)); @@ -1792,7 +1784,6 @@ fetch_token (re_token_t *result, re_string_t *input, reg_syntax_t syntax) We must not use this function inside bracket expressions. */ static int -internal_function peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax) { unsigned char c; @@ -2031,7 +2022,6 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax) We must not use this function out of bracket expressions. */ static int -internal_function peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax) { unsigned char c; @@ -2139,14 +2129,14 @@ parse (re_string_t *regexp, regex_t *preg, reg_syntax_t syntax, dfa->syntax = syntax; fetch_token (¤t_token, regexp, syntax | RE_CARET_ANCHORS_HERE); tree = parse_reg_exp (regexp, preg, ¤t_token, syntax, 0, err); - if (BE (*err != REG_NOERROR && tree == NULL, 0)) + if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL)) return NULL; eor = create_tree (dfa, NULL, NULL, END_OF_RE); if (tree != NULL) root = create_tree (dfa, tree, eor, CONCAT); else root = eor; - if (BE (eor == NULL || root == NULL, 0)) + if (__glibc_unlikely (eor == NULL || root == NULL)) { *err = REG_ESPACE; return NULL; @@ -2171,7 +2161,7 @@ parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, bin_tree_t *tree, *branch = NULL; bitset_word_t initial_bkref_map = dfa->completed_bkref_map; tree = parse_branch (regexp, preg, token, syntax, nest, err); - if (BE (*err != REG_NOERROR && tree == NULL, 0)) + if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL)) return NULL; while (token->type == OP_ALT) @@ -2183,7 +2173,7 @@ parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, bitset_word_t accumulated_bkref_map = dfa->completed_bkref_map; dfa->completed_bkref_map = initial_bkref_map; branch = parse_branch (regexp, preg, token, syntax, nest, err); - if (BE (*err != REG_NOERROR && branch == NULL, 0)) + if (__glibc_unlikely (*err != REG_NOERROR && branch == NULL)) { if (tree != NULL) postorder (tree, free_tree, NULL); @@ -2194,7 +2184,7 @@ parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, else branch = NULL; tree = create_tree (dfa, tree, branch, OP_ALT); - if (BE (tree == NULL, 0)) + if (__glibc_unlikely (tree == NULL)) { *err = REG_ESPACE; return NULL; @@ -2219,14 +2209,14 @@ parse_branch (re_string_t *regexp, regex_t *preg, re_token_t *token, bin_tree_t *tree, *expr; re_dfa_t *dfa = preg->buffer; tree = parse_expression (regexp, preg, token, syntax, nest, err); - if (BE (*err != REG_NOERROR && tree == NULL, 0)) + if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL)) return NULL; while (token->type != OP_ALT && token->type != END_OF_RE && (nest == 0 || token->type != OP_CLOSE_SUBEXP)) { expr = parse_expression (regexp, preg, token, syntax, nest, err); - if (BE (*err != REG_NOERROR && expr == NULL, 0)) + if (__glibc_unlikely (*err != REG_NOERROR && expr == NULL)) { if (tree != NULL) postorder (tree, free_tree, NULL); @@ -2267,7 +2257,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, { case CHARACTER: tree = create_token_tree (dfa, NULL, NULL, token); - if (BE (tree == NULL, 0)) + if (__glibc_unlikely (tree == NULL)) { *err = REG_ESPACE; return NULL; @@ -2282,7 +2272,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, fetch_token (token, regexp, syntax); mbc_remain = create_token_tree (dfa, NULL, NULL, token); tree = create_tree (dfa, tree, mbc_remain, CONCAT); - if (BE (mbc_remain == NULL || tree == NULL, 0)) + if (__glibc_unlikely (mbc_remain == NULL || tree == NULL)) { *err = REG_ESPACE; return NULL; @@ -2294,25 +2284,25 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, case OP_OPEN_SUBEXP: tree = parse_sub_exp (regexp, preg, token, syntax, nest + 1, err); - if (BE (*err != REG_NOERROR && tree == NULL, 0)) + if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL)) return NULL; break; case OP_OPEN_BRACKET: tree = parse_bracket_exp (regexp, dfa, token, syntax, err); - if (BE (*err != REG_NOERROR && tree == NULL, 0)) + if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL)) return NULL; break; case OP_BACK_REF: - if (!BE (dfa->completed_bkref_map & (1 << token->opr.idx), 1)) + if (!__glibc_likely (dfa->completed_bkref_map & (1 << token->opr.idx))) { *err = REG_ESUBREG; return NULL; } dfa->used_bkref_map |= 1 << token->opr.idx; tree = create_token_tree (dfa, NULL, NULL, token); - if (BE (tree == NULL, 0)) + if (__glibc_unlikely (tree == NULL)) { *err = REG_ESPACE; return NULL; @@ -2358,7 +2348,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, /* mb_partial and word_char bits should be initialized already by peek_token. */ tree = create_token_tree (dfa, NULL, NULL, token); - if (BE (tree == NULL, 0)) + if (__glibc_unlikely (tree == NULL)) { *err = REG_ESPACE; return NULL; @@ -2388,7 +2378,8 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, } tree_last = create_token_tree (dfa, NULL, NULL, token); tree = create_tree (dfa, tree_first, tree_last, OP_ALT); - if (BE (tree_first == NULL || tree_last == NULL || tree == NULL, 0)) + if (__glibc_unlikely (tree_first == NULL || tree_last == NULL + || tree == NULL)) { *err = REG_ESPACE; return NULL; @@ -2397,7 +2388,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, else { tree = create_token_tree (dfa, NULL, NULL, token); - if (BE (tree == NULL, 0)) + if (__glibc_unlikely (tree == NULL)) { *err = REG_ESPACE; return NULL; @@ -2412,7 +2403,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, case OP_PERIOD: tree = create_token_tree (dfa, NULL, NULL, token); - if (BE (tree == NULL, 0)) + if (__glibc_unlikely (tree == NULL)) { *err = REG_ESPACE; return NULL; @@ -2427,7 +2418,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, "alnum", "_", token->type == OP_NOTWORD, err); - if (BE (*err != REG_NOERROR && tree == NULL, 0)) + if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL)) return NULL; break; @@ -2437,7 +2428,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, "space", "", token->type == OP_NOTSPACE, err); - if (BE (*err != REG_NOERROR && tree == NULL, 0)) + if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL)) return NULL; break; @@ -2463,7 +2454,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, { bin_tree_t *dup_tree = parse_dup_op (tree, regexp, dfa, token, syntax, err); - if (BE (*err != REG_NOERROR && dup_tree == NULL, 0)) + if (__glibc_unlikely (*err != REG_NOERROR && dup_tree == NULL)) { if (tree != NULL) postorder (tree, free_tree, NULL); @@ -2509,13 +2500,14 @@ parse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, else { tree = parse_reg_exp (regexp, preg, token, syntax, nest, err); - if (BE (*err == REG_NOERROR && token->type != OP_CLOSE_SUBEXP, 0)) + if (__glibc_unlikely (*err == REG_NOERROR + && token->type != OP_CLOSE_SUBEXP)) { if (tree != NULL) postorder (tree, free_tree, NULL); *err = REG_EPAREN; } - if (BE (*err != REG_NOERROR, 0)) + if (__glibc_unlikely (*err != REG_NOERROR)) return NULL; } @@ -2523,7 +2515,7 @@ parse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, dfa->completed_bkref_map |= 1 << cur_nsub; tree = create_tree (dfa, tree, NULL, SUBEXP); - if (BE (tree == NULL, 0)) + if (__glibc_unlikely (tree == NULL)) { *err = REG_ESPACE; return NULL; @@ -2556,17 +2548,17 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa, return NULL; } } - if (BE (start != -2, 1)) + if (__glibc_likely (start != -2)) { /* We treat "{n}" as "{n,n}". */ end = ((token->type == OP_CLOSE_DUP_NUM) ? start : ((token->type == CHARACTER && token->opr.c == ',') ? fetch_number (regexp, token, syntax) : -2)); } - if (BE (start == -2 || end == -2, 0)) + if (__glibc_unlikely (start == -2 || end == -2)) { /* Invalid sequence. */ - if (BE (!(syntax & RE_INVALID_INTERVAL_ORD), 0)) + if (__glibc_unlikely (!(syntax & RE_INVALID_INTERVAL_ORD))) { if (token->type == END_OF_RE) *err = REG_EBRACE; @@ -2585,15 +2577,15 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa, return elem; } - if (BE ((end != -1 && start > end) - || token->type != OP_CLOSE_DUP_NUM, 0)) + if (__glibc_unlikely ((end != -1 && start > end) + || token->type != OP_CLOSE_DUP_NUM)) { /* First number greater than second. */ *err = REG_BADBR; return NULL; } - if (BE (RE_DUP_MAX < (end == -1 ? start : end), 0)) + if (__glibc_unlikely (RE_DUP_MAX < (end == -1 ? start : end))) { *err = REG_ESIZE; return NULL; @@ -2607,23 +2599,23 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa, fetch_token (token, regexp, syntax); - if (BE (elem == NULL, 0)) + if (__glibc_unlikely (elem == NULL)) return NULL; - if (BE (start == 0 && end == 0, 0)) + if (__glibc_unlikely (start == 0 && end == 0)) { postorder (elem, free_tree, NULL); return NULL; } /* Extract "{n,m}" to "...{0,}". */ - if (BE (start > 0, 0)) + if (__glibc_unlikely (start > 0)) { tree = elem; for (i = 2; i <= start; ++i) { elem = duplicate_tree (elem, dfa); tree = create_tree (dfa, tree, elem, CONCAT); - if (BE (elem == NULL || tree == NULL, 0)) + if (__glibc_unlikely (elem == NULL || tree == NULL)) goto parse_dup_op_espace; } @@ -2632,7 +2624,7 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa, /* Duplicate ELEM before it is marked optional. */ elem = duplicate_tree (elem, dfa); - if (BE (elem == NULL, 0)) + if (__glibc_unlikely (elem == NULL)) goto parse_dup_op_espace; old_tree = tree; } @@ -2647,13 +2639,9 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa, tree = create_tree (dfa, elem, NULL, (end == -1 ? OP_DUP_ASTERISK : OP_ALT)); - if (BE (tree == NULL, 0)) + if (__glibc_unlikely (tree == NULL)) goto parse_dup_op_espace; -/* From gnulib's "intprops.h": - True if the arithmetic type T is signed. */ -#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) - /* This loop is actually executed only when end != -1, to rewrite {0,n} as ((...?)?)?... We have already created the start+1-th copy. */ @@ -2662,11 +2650,11 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa, { elem = duplicate_tree (elem, dfa); tree = create_tree (dfa, tree, elem, CONCAT); - if (BE (elem == NULL || tree == NULL, 0)) + if (__glibc_unlikely (elem == NULL || tree == NULL)) goto parse_dup_op_espace; tree = create_tree (dfa, tree, NULL, OP_ALT); - if (BE (tree == NULL, 0)) + if (__glibc_unlikely (tree == NULL)) goto parse_dup_op_espace; } @@ -2688,15 +2676,14 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa, # ifdef RE_ENABLE_I18N /* Convert the byte B to the corresponding wide character. In a - unibyte locale, treat B as itself if it is an encoding error. - In a multibyte locale, return WEOF if B is an encoding error. */ + unibyte locale, treat B as itself. In a multibyte locale, return + WEOF if B is an encoding error. */ static wint_t parse_byte (unsigned char b, re_charset_t *mbcset) { - wint_t wc = __btowc (b); - return wc == WEOF && !mbcset ? b : wc; + return mbcset == NULL ? b : __btowc (b); } -#endif +# endif /* Local function for parse_bracket_exp only used in case of NOT _LIBC. Build the range expression which starts from START_ELEM, and ends @@ -2706,7 +2693,6 @@ parse_byte (unsigned char b, re_charset_t *mbcset) update it. */ static reg_errcode_t -internal_function # ifdef RE_ENABLE_I18N build_range_exp (const reg_syntax_t syntax, bitset_t sbcset, @@ -2723,17 +2709,18 @@ build_range_exp (const reg_syntax_t syntax, { unsigned int start_ch, end_ch; /* Equivalence Classes and Character Classes can't be a range start/end. */ - if (BE (start_elem->type == EQUIV_CLASS || start_elem->type == CHAR_CLASS - || end_elem->type == EQUIV_CLASS || end_elem->type == CHAR_CLASS, - 0)) + if (__glibc_unlikely (start_elem->type == EQUIV_CLASS + || start_elem->type == CHAR_CLASS + || end_elem->type == EQUIV_CLASS + || end_elem->type == CHAR_CLASS)) return REG_ERANGE; /* We can handle no multi character collating elements without libc support. */ - if (BE ((start_elem->type == COLL_SYM - && strlen ((char *) start_elem->opr.name) > 1) - || (end_elem->type == COLL_SYM - && strlen ((char *) end_elem->opr.name) > 1), 0)) + if (__glibc_unlikely ((start_elem->type == COLL_SYM + && strlen ((char *) start_elem->opr.name) > 1) + || (end_elem->type == COLL_SYM + && strlen ((char *) end_elem->opr.name) > 1))) return REG_ECOLLATE; # ifdef RE_ENABLE_I18N @@ -2754,7 +2741,8 @@ build_range_exp (const reg_syntax_t syntax, ? parse_byte (end_ch, mbcset) : end_elem->opr.wch); if (start_wc == WEOF || end_wc == WEOF) return REG_ECOLLATE; - else if (BE ((syntax & RE_NO_EMPTY_RANGES) && start_wc > end_wc, 0)) + else if (__glibc_unlikely ((syntax & RE_NO_EMPTY_RANGES) + && start_wc > end_wc)) return REG_ERANGE; /* Got valid collation sequence values, add them as a new entry. @@ -2765,7 +2753,7 @@ build_range_exp (const reg_syntax_t syntax, if (mbcset) { /* Check the space of the arrays. */ - if (BE (*range_alloc == mbcset->nranges, 0)) + if (__glibc_unlikely (*range_alloc == mbcset->nranges)) { /* There is not enough space, need realloc. */ wchar_t *new_array_start, *new_array_end; @@ -2780,7 +2768,8 @@ build_range_exp (const reg_syntax_t syntax, new_array_end = re_realloc (mbcset->range_ends, wchar_t, new_nranges); - if (BE (new_array_start == NULL || new_array_end == NULL, 0)) + if (__glibc_unlikely (new_array_start == NULL + || new_array_end == NULL)) { re_free (new_array_start); re_free (new_array_end); @@ -2832,7 +2821,6 @@ build_range_exp (const reg_syntax_t syntax, pointer argument since we may update it. */ static reg_errcode_t -internal_function # ifdef RE_ENABLE_I18N build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset, Idx *coll_sym_alloc, const unsigned char *name) @@ -2841,7 +2829,7 @@ build_collating_symbol (bitset_t sbcset, const unsigned char *name) # endif /* not RE_ENABLE_I18N */ { size_t name_len = strlen ((const char *) name); - if (BE (name_len != 1, 0)) + if (__glibc_unlikely (name_len != 1)) return REG_ECOLLATE; else { @@ -2976,18 +2964,21 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, /* Equivalence Classes and Character Classes can't be a range start/end. */ - if (BE (start_elem->type == EQUIV_CLASS || start_elem->type == CHAR_CLASS - || end_elem->type == EQUIV_CLASS || end_elem->type == CHAR_CLASS, - 0)) + if (__glibc_unlikely (start_elem->type == EQUIV_CLASS + || start_elem->type == CHAR_CLASS + || end_elem->type == EQUIV_CLASS + || end_elem->type == CHAR_CLASS)) return REG_ERANGE; /* FIXME: Implement rational ranges here, too. */ start_collseq = lookup_collation_sequence_value (start_elem); end_collseq = lookup_collation_sequence_value (end_elem); /* Check start/end collation sequence values. */ - if (BE (start_collseq == UINT_MAX || end_collseq == UINT_MAX, 0)) + if (__glibc_unlikely (start_collseq == UINT_MAX + || end_collseq == UINT_MAX)) return REG_ECOLLATE; - if (BE ((syntax & RE_NO_EMPTY_RANGES) && start_collseq > end_collseq, 0)) + if (__glibc_unlikely ((syntax & RE_NO_EMPTY_RANGES) + && start_collseq > end_collseq)) return REG_ERANGE; /* Got valid collation sequence values, add them as a new entry. @@ -2997,7 +2988,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, if (nrules > 0 || dfa->mb_cur_max > 1) { /* Check the space of the arrays. */ - if (BE (*range_alloc == mbcset->nranges, 0)) + if (__glibc_unlikely (*range_alloc == mbcset->nranges)) { /* There is not enough space, need realloc. */ uint32_t *new_array_start; @@ -3011,7 +3002,8 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, new_array_end = re_realloc (mbcset->range_ends, uint32_t, new_nranges); - if (BE (new_array_start == NULL || new_array_end == NULL, 0)) + if (__glibc_unlikely (new_array_start == NULL + || new_array_end == NULL)) return REG_ESPACE; mbcset->range_starts = new_array_start; @@ -3075,7 +3067,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, /* Got valid collation sequence, add it as a new entry. */ /* Check the space of the arrays. */ - if (BE (*coll_sym_alloc == mbcset->ncoll_syms, 0)) + if (__glibc_unlikely (*coll_sym_alloc == mbcset->ncoll_syms)) { /* Not enough, realloc it. */ /* +1 in case of mbcset->ncoll_syms is 0. */ @@ -3084,7 +3076,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, if *alloc == 0. */ int32_t *new_coll_syms = re_realloc (mbcset->coll_syms, int32_t, new_coll_sym_alloc); - if (BE (new_coll_syms == NULL, 0)) + if (__glibc_unlikely (new_coll_syms == NULL)) return REG_ESPACE; mbcset->coll_syms = new_coll_syms; *coll_sym_alloc = new_coll_sym_alloc; @@ -3094,7 +3086,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, } else { - if (BE (name_len != 1, 0)) + if (__glibc_unlikely (name_len != 1)) return REG_ECOLLATE; else { @@ -3138,9 +3130,9 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1); #endif /* RE_ENABLE_I18N */ #ifdef RE_ENABLE_I18N - if (BE (sbcset == NULL || mbcset == NULL, 0)) + if (__glibc_unlikely (sbcset == NULL || mbcset == NULL)) #else - if (BE (sbcset == NULL, 0)) + if (__glibc_unlikely (sbcset == NULL)) #endif /* RE_ENABLE_I18N */ { re_free (sbcset); @@ -3152,7 +3144,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, } token_len = peek_token_bracket (token, regexp, syntax); - if (BE (token->type == END_OF_RE, 0)) + if (__glibc_unlikely (token->type == END_OF_RE)) { *err = REG_BADPAT; goto parse_bracket_exp_free_return; @@ -3167,7 +3159,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, bitset_set (sbcset, '\n'); re_string_skip_bytes (regexp, token_len); /* Skip a token. */ token_len = peek_token_bracket (token, regexp, syntax); - if (BE (token->type == END_OF_RE, 0)) + if (__glibc_unlikely (token->type == END_OF_RE)) { *err = REG_BADPAT; goto parse_bracket_exp_free_return; @@ -3192,7 +3184,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, start_elem.type = COLL_SYM; ret = parse_bracket_element (&start_elem, regexp, token, token_len, dfa, syntax, first_round); - if (BE (ret != REG_NOERROR, 0)) + if (__glibc_unlikely (ret != REG_NOERROR)) { *err = ret; goto parse_bracket_exp_free_return; @@ -3205,7 +3197,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, /* Do not check for ranges if we know they are not allowed. */ if (start_elem.type != CHAR_CLASS && start_elem.type != EQUIV_CLASS) { - if (BE (token->type == END_OF_RE, 0)) + if (__glibc_unlikely (token->type == END_OF_RE)) { *err = REG_EBRACK; goto parse_bracket_exp_free_return; @@ -3214,7 +3206,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, { re_string_skip_bytes (regexp, token_len); /* Skip '-'. */ token_len2 = peek_token_bracket (&token2, regexp, syntax); - if (BE (token2.type == END_OF_RE, 0)) + if (__glibc_unlikely (token2.type == END_OF_RE)) { *err = REG_EBRACK; goto parse_bracket_exp_free_return; @@ -3236,7 +3228,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, end_elem.type = COLL_SYM; ret = parse_bracket_element (&end_elem, regexp, &token2, token_len2, dfa, syntax, true); - if (BE (ret != REG_NOERROR, 0)) + if (__glibc_unlikely (ret != REG_NOERROR)) { *err = ret; goto parse_bracket_exp_free_return; @@ -3256,7 +3248,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, *err = build_range_exp (syntax, sbcset, &start_elem, &end_elem); # endif #endif /* RE_ENABLE_I18N */ - if (BE (*err != REG_NOERROR, 0)) + if (__glibc_unlikely (*err != REG_NOERROR)) goto parse_bracket_exp_free_return; } else @@ -3269,7 +3261,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, #ifdef RE_ENABLE_I18N case MB_CHAR: /* Check whether the array has enough space. */ - if (BE (mbchar_alloc == mbcset->nmbchars, 0)) + if (__glibc_unlikely (mbchar_alloc == mbcset->nmbchars)) { wchar_t *new_mbchars; /* Not enough, realloc it. */ @@ -3278,7 +3270,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, /* Use realloc since array is NULL if *alloc == 0. */ new_mbchars = re_realloc (mbcset->mbchars, wchar_t, mbchar_alloc); - if (BE (new_mbchars == NULL, 0)) + if (__glibc_unlikely (new_mbchars == NULL)) goto parse_bracket_exp_espace; mbcset->mbchars = new_mbchars; } @@ -3291,7 +3283,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, mbcset, &equiv_class_alloc, #endif /* RE_ENABLE_I18N */ start_elem.opr.name); - if (BE (*err != REG_NOERROR, 0)) + if (__glibc_unlikely (*err != REG_NOERROR)) goto parse_bracket_exp_free_return; break; case COLL_SYM: @@ -3300,7 +3292,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, mbcset, &coll_sym_alloc, #endif /* RE_ENABLE_I18N */ start_elem.opr.name); - if (BE (*err != REG_NOERROR, 0)) + if (__glibc_unlikely (*err != REG_NOERROR)) goto parse_bracket_exp_free_return; break; case CHAR_CLASS: @@ -3310,7 +3302,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, #endif /* RE_ENABLE_I18N */ (const char *) start_elem.opr.name, syntax); - if (BE (*err != REG_NOERROR, 0)) + if (__glibc_unlikely (*err != REG_NOERROR)) goto parse_bracket_exp_free_return; break; default: @@ -3318,7 +3310,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, break; } } - if (BE (token->type == END_OF_RE, 0)) + if (__glibc_unlikely (token->type == END_OF_RE)) { *err = REG_EBRACK; goto parse_bracket_exp_free_return; @@ -3349,7 +3341,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, br_token.type = COMPLEX_BRACKET; br_token.opr.mbcset = mbcset; mbc_tree = create_token_tree (dfa, NULL, NULL, &br_token); - if (BE (mbc_tree == NULL, 0)) + if (__glibc_unlikely (mbc_tree == NULL)) goto parse_bracket_exp_espace; for (sbc_idx = 0; sbc_idx < BITSET_WORDS; ++sbc_idx) if (sbcset[sbc_idx]) @@ -3362,12 +3354,12 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, br_token.type = SIMPLE_BRACKET; br_token.opr.sbcset = sbcset; work_tree = create_token_tree (dfa, NULL, NULL, &br_token); - if (BE (work_tree == NULL, 0)) + if (__glibc_unlikely (work_tree == NULL)) goto parse_bracket_exp_espace; /* Then join them by ALT node. */ work_tree = create_tree (dfa, work_tree, mbc_tree, OP_ALT); - if (BE (work_tree == NULL, 0)) + if (__glibc_unlikely (work_tree == NULL)) goto parse_bracket_exp_espace; } else @@ -3386,7 +3378,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, br_token.type = SIMPLE_BRACKET; br_token.opr.sbcset = sbcset; work_tree = create_token_tree (dfa, NULL, NULL, &br_token); - if (BE (work_tree == NULL, 0)) + if (__glibc_unlikely (work_tree == NULL)) goto parse_bracket_exp_espace; } return work_tree; @@ -3423,7 +3415,7 @@ parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp, if (token->type == OP_OPEN_COLL_ELEM || token->type == OP_OPEN_CHAR_CLASS || token->type == OP_OPEN_EQUIV_CLASS) return parse_bracket_symbol (elem, regexp, token); - if (BE (token->type == OP_CHARSET_RANGE, 0) && !accept_hyphen) + if (__glibc_unlikely (token->type == OP_CHARSET_RANGE) && !accept_hyphen) { /* A '-' must only appear as anything but a range indicator before the closing bracket. Everything else is an error. */ @@ -3518,7 +3510,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name) indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); idx1 = findidx (table, indirect, extra, &cp, -1); - if (BE (idx1 == 0 || *cp != '\0', 0)) + if (__glibc_unlikely (idx1 == 0 || *cp != '\0')) /* This isn't a valid character. */ return REG_ECOLLATE; @@ -3537,21 +3529,13 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name) continue; /* Compare only if the length matches and the collation rule index is the same. */ - if (len == weights[idx2 & 0xffffff] && (idx1 >> 24) == (idx2 >> 24)) - { - int cnt = 0; - - while (cnt <= len && - weights[(idx1 & 0xffffff) + 1 + cnt] - == weights[(idx2 & 0xffffff) + 1 + cnt]) - ++cnt; - - if (cnt > len) - bitset_set (sbcset, ch); - } + if (len == weights[idx2 & 0xffffff] && (idx1 >> 24) == (idx2 >> 24) + && memcmp (weights + (idx1 & 0xffffff) + 1, + weights + (idx2 & 0xffffff) + 1, len) == 0) + bitset_set (sbcset, ch); } /* Check whether the array has enough space. */ - if (BE (*equiv_class_alloc == mbcset->nequiv_classes, 0)) + if (__glibc_unlikely (*equiv_class_alloc == mbcset->nequiv_classes)) { /* Not enough, realloc it. */ /* +1 in case of mbcset->nequiv_classes is 0. */ @@ -3560,7 +3544,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name) int32_t *new_equiv_classes = re_realloc (mbcset->equiv_classes, int32_t, new_equiv_class_alloc); - if (BE (new_equiv_classes == NULL, 0)) + if (__glibc_unlikely (new_equiv_classes == NULL)) return REG_ESPACE; mbcset->equiv_classes = new_equiv_classes; *equiv_class_alloc = new_equiv_class_alloc; @@ -3570,7 +3554,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name) else #endif /* _LIBC */ { - if (BE (strlen ((const char *) name) != 1, 0)) + if (__glibc_unlikely (strlen ((const char *) name) != 1)) return REG_ECOLLATE; bitset_set (sbcset, *name); } @@ -3604,7 +3588,7 @@ build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset, #ifdef RE_ENABLE_I18N /* Check the space of the arrays. */ - if (BE (*char_class_alloc == mbcset->nchar_classes, 0)) + if (__glibc_unlikely (*char_class_alloc == mbcset->nchar_classes)) { /* Not enough, realloc it. */ /* +1 in case of mbcset->nchar_classes is 0. */ @@ -3612,7 +3596,7 @@ build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset, /* Use realloc since array is NULL if *alloc == 0. */ wctype_t *new_char_classes = re_realloc (mbcset->char_classes, wctype_t, new_char_class_alloc); - if (BE (new_char_classes == NULL, 0)) + if (__glibc_unlikely (new_char_classes == NULL)) return REG_ESPACE; mbcset->char_classes = new_char_classes; *char_class_alloc = new_char_class_alloc; @@ -3622,7 +3606,7 @@ build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset, #define BUILD_CHARCLASS_LOOP(ctype_func) \ do { \ - if (BE (trans != NULL, 0)) \ + if (__glibc_unlikely (trans != NULL)) \ { \ for (i = 0; i < SBC_MAX; ++i) \ if (ctype_func (i)) \ @@ -3682,14 +3666,14 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans, bin_tree_t *tree; sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1); - if (BE (sbcset == NULL, 0)) + if (__glibc_unlikely (sbcset == NULL)) { *err = REG_ESPACE; return NULL; } #ifdef RE_ENABLE_I18N mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1); - if (BE (mbcset == NULL, 0)) + if (__glibc_unlikely (mbcset == NULL)) { re_free (sbcset); *err = REG_ESPACE; @@ -3705,7 +3689,7 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans, #endif /* RE_ENABLE_I18N */ class_name, 0); - if (BE (ret != REG_NOERROR, 0)) + if (__glibc_unlikely (ret != REG_NOERROR)) { re_free (sbcset); #ifdef RE_ENABLE_I18N @@ -3735,7 +3719,7 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans, br_token.type = SIMPLE_BRACKET; br_token.opr.sbcset = sbcset; tree = create_token_tree (dfa, NULL, NULL, &br_token); - if (BE (tree == NULL, 0)) + if (__glibc_unlikely (tree == NULL)) goto build_word_op_espace; #ifdef RE_ENABLE_I18N @@ -3747,11 +3731,11 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans, br_token.opr.mbcset = mbcset; dfa->has_mb_node = 1; mbc_tree = create_token_tree (dfa, NULL, NULL, &br_token); - if (BE (mbc_tree == NULL, 0)) + if (__glibc_unlikely (mbc_tree == NULL)) goto build_word_op_espace; /* Then join them by ALT node. */ tree = create_tree (dfa, tree, mbc_tree, OP_ALT); - if (BE (mbc_tree != NULL, 1)) + if (__glibc_likely (mbc_tree != NULL)) return tree; } else @@ -3787,7 +3771,7 @@ fetch_number (re_string_t *input, re_token_t *token, reg_syntax_t syntax) { fetch_token (token, input, syntax); c = token->opr.c; - if (BE (token->type == END_OF_RE, 0)) + if (__glibc_unlikely (token->type == END_OF_RE)) return -2; if (token->type == OP_CLOSE_DUP_NUM || c == ',') break; @@ -3808,9 +3792,9 @@ free_charset (re_charset_t *cset) # ifdef _LIBC re_free (cset->coll_syms); re_free (cset->equiv_classes); +# endif re_free (cset->range_starts); re_free (cset->range_ends); -# endif re_free (cset->char_classes); re_free (cset); } @@ -3837,7 +3821,7 @@ create_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right, const re_token_t *token) { bin_tree_t *tree; - if (BE (dfa->str_tree_storage_idx == BIN_TREE_STORAGE_SIZE, 0)) + if (__glibc_unlikely (dfa->str_tree_storage_idx == BIN_TREE_STORAGE_SIZE)) { bin_tree_storage_t *storage = re_malloc (bin_tree_storage_t, 1); diff --git a/gnu/regex.c b/gnu/regex.c index 998d95e5bdda0c3fbb24b908146585294ec8491c..eab7a48b24008c72c6ef63697401b4916605e93e 100644 --- a/gnu/regex.c +++ b/gnu/regex.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -18,12 +18,12 @@ . */ #ifndef _LIBC -# include +# include -# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ +# if __GNUC_PREREQ (4, 6) # pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" # endif -# if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__ +# if __GNUC_PREREQ (4, 3) # pragma GCC diagnostic ignored "-Wold-style-definition" # pragma GCC diagnostic ignored "-Wtype-limits" # endif diff --git a/gnu/regex.h b/gnu/regex.h index b236a1b34fc7a199082622cc2576ad2fe132099b..77ac1a559c4d84d2915f91e4736839e97a409fbd 100644 --- a/gnu/regex.h +++ b/gnu/regex.h @@ -1,7 +1,6 @@ /* Definitions for data structures and routines for the regular expression library. - Copyright (C) 1985, 1989-1993, 1995-1998, 2000-2003, 2005-2017 Free Software - Foundation, Inc. + Copyright (C) 1985, 1989-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -608,28 +607,28 @@ extern int re_exec (const char *); # endif #endif -/* GCC 2.95 and later have "__restrict"; C99 compilers have +/* For plain 'restrict', use glibc's __restrict if defined. + Otherwise, GCC 2.95 and later have "__restrict"; C99 compilers have "restrict", and "configure" may have defined "restrict". Other compilers use __restrict, __restrict__, and _Restrict, and 'configure' might #define 'restrict' to those words, so pick a different name. */ #ifndef _Restrict_ -# if 199901L <= __STDC_VERSION__ -# define _Restrict_ restrict -# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__) +# if defined __restrict || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) # define _Restrict_ __restrict +# elif 199901L <= __STDC_VERSION__ || defined restrict +# define _Restrict_ restrict # else # define _Restrict_ # endif #endif -/* gcc 3.1 and up support the [restrict] syntax. Don't trust - sys/cdefs.h's definition of __restrict_arr, though, as it - mishandles gcc -ansi -pedantic. */ +/* For [restrict], use glibc's __restrict_arr if available. + Otherwise, GCC 3.1 (not in C++ mode) and C99 support [restrict]. */ #ifndef _Restrict_arr_ -# if ((199901L <= __STDC_VERSION__ \ - || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__)) \ - && !defined __STRICT_ANSI__)) \ - && !defined __GNUG__) +# ifdef __restrict_arr +# define _Restrict_arr_ __restrict_arr +# elif ((199901L <= __STDC_VERSION__ || 3 < __GNUC__ + (1 <= __GNUC_MINOR__)) \ + && !defined __GNUG__) # define _Restrict_arr_ _Restrict_ # else # define _Restrict_arr_ diff --git a/gnu/regex_internal.c b/gnu/regex_internal.c index a77319b9d0933ee647354f3453456b89c9a09242..b592f06725c1e1177594029e3c549229716a98b6 100644 --- a/gnu/regex_internal.c +++ b/gnu/regex_internal.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -20,14 +20,24 @@ static void re_string_construct_common (const char *str, Idx len, re_string_t *pstr, RE_TRANSLATE_TYPE trans, bool icase, - const re_dfa_t *dfa) internal_function; + const re_dfa_t *dfa); static re_dfastate_t *create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes, - re_hashval_t hash) internal_function; + re_hashval_t hash); static re_dfastate_t *create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes, unsigned int context, - re_hashval_t hash) internal_function; + re_hashval_t hash); +static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr, + Idx new_buf_len); +#ifdef RE_ENABLE_I18N +static void build_wcs_buffer (re_string_t *pstr); +static reg_errcode_t build_wcs_upper_buffer (re_string_t *pstr); +#endif /* RE_ENABLE_I18N */ +static void build_upper_buffer (re_string_t *pstr); +static void re_string_translate_buffer (re_string_t *pstr); +static unsigned int re_string_context_at (const re_string_t *input, Idx idx, + int eflags) __attribute__ ((pure)); /* Functions for string operation. */ @@ -35,7 +45,7 @@ static re_dfastate_t *create_cd_newstate (const re_dfa_t *dfa, re_string_reconstruct before using the object. */ static reg_errcode_t -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ re_string_allocate (re_string_t *pstr, const char *str, Idx len, Idx init_len, RE_TRANSLATE_TYPE trans, bool icase, const re_dfa_t *dfa) { @@ -49,7 +59,7 @@ re_string_allocate (re_string_t *pstr, const char *str, Idx len, Idx init_len, re_string_construct_common (str, len, pstr, trans, icase, dfa); ret = re_string_realloc_buffers (pstr, init_buf_len); - if (BE (ret != REG_NOERROR, 0)) + if (__glibc_unlikely (ret != REG_NOERROR)) return ret; pstr->word_char = dfa->word_char; @@ -63,7 +73,7 @@ re_string_allocate (re_string_t *pstr, const char *str, Idx len, Idx init_len, /* This function allocate the buffers, and initialize them. */ static reg_errcode_t -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ re_string_construct (re_string_t *pstr, const char *str, Idx len, RE_TRANSLATE_TYPE trans, bool icase, const re_dfa_t *dfa) { @@ -74,7 +84,7 @@ re_string_construct (re_string_t *pstr, const char *str, Idx len, if (len > 0) { ret = re_string_realloc_buffers (pstr, len + 1); - if (BE (ret != REG_NOERROR, 0)) + if (__glibc_unlikely (ret != REG_NOERROR)) return ret; } pstr->mbs = pstr->mbs_allocated ? pstr->mbs : (unsigned char *) str; @@ -87,14 +97,14 @@ re_string_construct (re_string_t *pstr, const char *str, Idx len, while (1) { ret = build_wcs_upper_buffer (pstr); - if (BE (ret != REG_NOERROR, 0)) + if (__glibc_unlikely (ret != REG_NOERROR)) return ret; if (pstr->valid_raw_len >= len) break; if (pstr->bufs_len > pstr->valid_len + dfa->mb_cur_max) break; ret = re_string_realloc_buffers (pstr, pstr->bufs_len * 2); - if (BE (ret != REG_NOERROR, 0)) + if (__glibc_unlikely (ret != REG_NOERROR)) return ret; } } @@ -126,7 +136,7 @@ re_string_construct (re_string_t *pstr, const char *str, Idx len, /* Helper functions for re_string_allocate, and re_string_construct. */ static reg_errcode_t -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ re_string_realloc_buffers (re_string_t *pstr, Idx new_buf_len) { #ifdef RE_ENABLE_I18N @@ -136,17 +146,18 @@ re_string_realloc_buffers (re_string_t *pstr, Idx new_buf_len) /* Avoid overflow in realloc. */ const size_t max_object_size = MAX (sizeof (wint_t), sizeof (Idx)); - if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) < new_buf_len, 0)) + if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / max_object_size) + < new_buf_len)) return REG_ESPACE; new_wcs = re_realloc (pstr->wcs, wint_t, new_buf_len); - if (BE (new_wcs == NULL, 0)) + if (__glibc_unlikely (new_wcs == NULL)) return REG_ESPACE; pstr->wcs = new_wcs; if (pstr->offsets != NULL) { Idx *new_offsets = re_realloc (pstr->offsets, Idx, new_buf_len); - if (BE (new_offsets == NULL, 0)) + if (__glibc_unlikely (new_offsets == NULL)) return REG_ESPACE; pstr->offsets = new_offsets; } @@ -156,7 +167,7 @@ re_string_realloc_buffers (re_string_t *pstr, Idx new_buf_len) { unsigned char *new_mbs = re_realloc (pstr->mbs, unsigned char, new_buf_len); - if (BE (new_mbs == NULL, 0)) + if (__glibc_unlikely (new_mbs == NULL)) return REG_ESPACE; pstr->mbs = new_mbs; } @@ -166,7 +177,6 @@ re_string_realloc_buffers (re_string_t *pstr, Idx new_buf_len) static void -internal_function re_string_construct_common (const char *str, Idx len, re_string_t *pstr, RE_TRANSLATE_TYPE trans, bool icase, const re_dfa_t *dfa) @@ -198,7 +208,6 @@ re_string_construct_common (const char *str, Idx len, re_string_t *pstr, built and starts from PSTR->VALID_LEN. */ static void -internal_function build_wcs_buffer (re_string_t *pstr) { #ifdef _LIBC @@ -222,7 +231,7 @@ build_wcs_buffer (re_string_t *pstr) remain_len = end_idx - byte_idx; prev_st = pstr->cur_state; /* Apply the translation if we need. */ - if (BE (pstr->trans != NULL, 0)) + if (__glibc_unlikely (pstr->trans != NULL)) { int i, ch; @@ -236,17 +245,18 @@ build_wcs_buffer (re_string_t *pstr) else p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx; mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state); - if (BE (mbclen == (size_t) -1 || mbclen == 0 - || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len), 0)) + if (__glibc_unlikely (mbclen == (size_t) -1 || mbclen == 0 + || (mbclen == (size_t) -2 + && pstr->bufs_len >= pstr->len))) { /* We treat these cases as a singlebyte character. */ mbclen = 1; wc = (wchar_t) pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]; - if (BE (pstr->trans != NULL, 0)) + if (__glibc_unlikely (pstr->trans != NULL)) wc = pstr->trans[wc]; pstr->cur_state = prev_st; } - else if (BE (mbclen == (size_t) -2, 0)) + else if (__glibc_unlikely (mbclen == (size_t) -2)) { /* The buffer doesn't have enough space, finish to build. */ pstr->cur_state = prev_st; @@ -267,7 +277,7 @@ build_wcs_buffer (re_string_t *pstr) but for REG_ICASE. */ static reg_errcode_t -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ build_wcs_upper_buffer (re_string_t *pstr) { mbstate_t prev_st; @@ -309,7 +319,7 @@ build_wcs_upper_buffer (re_string_t *pstr) mbclen = __mbrtowc (&wc, ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx), remain_len, &pstr->cur_state); - if (BE (mbclen < (size_t) -2, 1)) + if (__glibc_likely (0 < mbclen && mbclen < (size_t) -2)) { wchar_t wcu = __towupper (wc); if (wcu != wc) @@ -317,7 +327,7 @@ build_wcs_upper_buffer (re_string_t *pstr) size_t mbcdlen; mbcdlen = __wcrtomb (buf, wcu, &prev_st); - if (BE (mbclen == mbcdlen, 1)) + if (__glibc_likely (mbclen == mbcdlen)) memcpy (pstr->mbs + byte_idx, buf, mbclen); else { @@ -342,7 +352,7 @@ build_wcs_upper_buffer (re_string_t *pstr) pstr->mbs[byte_idx] = ch; /* And also cast it to wide char. */ pstr->wcs[byte_idx++] = (wchar_t) ch; - if (BE (mbclen == (size_t) -1, 0)) + if (__glibc_unlikely (mbclen == (size_t) -1)) pstr->cur_state = prev_st; } else @@ -364,7 +374,7 @@ build_wcs_upper_buffer (re_string_t *pstr) offsets_needed: remain_len = end_idx - byte_idx; prev_st = pstr->cur_state; - if (BE (pstr->trans != NULL, 0)) + if (__glibc_unlikely (pstr->trans != NULL)) { int i, ch; @@ -378,15 +388,15 @@ build_wcs_upper_buffer (re_string_t *pstr) else p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + src_idx; mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state); - if (BE (mbclen < (size_t) -2, 1)) + if (__glibc_likely (0 < mbclen && mbclen < (size_t) -2)) { wchar_t wcu = __towupper (wc); if (wcu != wc) { size_t mbcdlen; - mbcdlen = wcrtomb ((char *) buf, wcu, &prev_st); - if (BE (mbclen == mbcdlen, 1)) + mbcdlen = __wcrtomb ((char *) buf, wcu, &prev_st); + if (__glibc_likely (mbclen == mbcdlen)) memcpy (pstr->mbs + byte_idx, buf, mbclen); else if (mbcdlen != (size_t) -1) { @@ -436,7 +446,7 @@ build_wcs_upper_buffer (re_string_t *pstr) else memcpy (pstr->mbs + byte_idx, p, mbclen); - if (BE (pstr->offsets_needed != 0, 0)) + if (__glibc_unlikely (pstr->offsets_needed != 0)) { size_t i; for (i = 0; i < mbclen; ++i) @@ -455,17 +465,17 @@ build_wcs_upper_buffer (re_string_t *pstr) /* It is an invalid character or '\0'. Just use the byte. */ int ch = pstr->raw_mbs[pstr->raw_mbs_idx + src_idx]; - if (BE (pstr->trans != NULL, 0)) + if (__glibc_unlikely (pstr->trans != NULL)) ch = pstr->trans [ch]; pstr->mbs[byte_idx] = ch; - if (BE (pstr->offsets_needed != 0, 0)) + if (__glibc_unlikely (pstr->offsets_needed != 0)) pstr->offsets[byte_idx] = src_idx; ++src_idx; /* And also cast it to wide char. */ pstr->wcs[byte_idx++] = (wchar_t) ch; - if (BE (mbclen == (size_t) -1, 0)) + if (__glibc_unlikely (mbclen == (size_t) -1)) pstr->cur_state = prev_st; } else @@ -484,7 +494,6 @@ build_wcs_upper_buffer (re_string_t *pstr) Return the index. */ static Idx -internal_function re_string_skip_chars (re_string_t *pstr, Idx new_raw_idx, wint_t *last_wc) { mbstate_t prev_st; @@ -501,7 +510,8 @@ re_string_skip_chars (re_string_t *pstr, Idx new_raw_idx, wint_t *last_wc) prev_st = pstr->cur_state; mbclen = __mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx, remain_len, &pstr->cur_state); - if (BE (mbclen == (size_t) -2 || mbclen == (size_t) -1 || mbclen == 0, 0)) + if (__glibc_unlikely (mbclen == (size_t) -2 || mbclen == (size_t) -1 + || mbclen == 0)) { /* We treat these cases as a single byte character. */ if (mbclen == 0 || remain_len == 0) @@ -525,7 +535,6 @@ re_string_skip_chars (re_string_t *pstr, Idx new_raw_idx, wint_t *last_wc) This function is used in case of REG_ICASE. */ static void -internal_function build_upper_buffer (re_string_t *pstr) { Idx char_idx, end_idx; @@ -534,7 +543,7 @@ build_upper_buffer (re_string_t *pstr) for (char_idx = pstr->valid_len; char_idx < end_idx; ++char_idx) { int ch = pstr->raw_mbs[pstr->raw_mbs_idx + char_idx]; - if (BE (pstr->trans != NULL, 0)) + if (__glibc_unlikely (pstr->trans != NULL)) ch = pstr->trans[ch]; pstr->mbs[char_idx] = toupper (ch); } @@ -545,7 +554,6 @@ build_upper_buffer (re_string_t *pstr) /* Apply TRANS to the buffer in PSTR. */ static void -internal_function re_string_translate_buffer (re_string_t *pstr) { Idx buf_idx, end_idx; @@ -566,12 +574,12 @@ re_string_translate_buffer (re_string_t *pstr) convert to upper case in case of REG_ICASE, apply translation. */ static reg_errcode_t -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) { Idx offset; - if (BE (pstr->raw_mbs_idx <= idx, 0)) + if (__glibc_unlikely (pstr->raw_mbs_idx <= idx)) offset = idx - pstr->raw_mbs_idx; else { @@ -593,14 +601,14 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) offset = idx; } - if (BE (offset != 0, 1)) + if (__glibc_likely (offset != 0)) { /* Should the already checked characters be kept? */ - if (BE (offset < pstr->valid_raw_len, 1)) + if (__glibc_likely (offset < pstr->valid_raw_len)) { /* Yes, move them to the front of the buffer. */ #ifdef RE_ENABLE_I18N - if (BE (pstr->offsets_needed, 0)) + if (__glibc_unlikely (pstr->offsets_needed)) { Idx low = 0, high = pstr->valid_len, mid; do @@ -672,7 +680,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) memmove (pstr->wcs, pstr->wcs + offset, (pstr->valid_len - offset) * sizeof (wint_t)); #endif /* RE_ENABLE_I18N */ - if (BE (pstr->mbs_allocated, 0)) + if (__glibc_unlikely (pstr->mbs_allocated)) memmove (pstr->mbs, pstr->mbs + offset, pstr->valid_len - offset); pstr->valid_len -= offset; @@ -688,7 +696,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) /* No, skip all characters until IDX. */ Idx prev_valid_len = pstr->valid_len; - if (BE (pstr->offsets_needed, 0)) + if (__glibc_unlikely (pstr->offsets_needed)) { pstr->len = pstr->raw_len - idx + offset; pstr->stop = pstr->raw_stop - idx + offset; @@ -716,7 +724,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) #ifdef _LIBC /* We know the wchar_t encoding is UCS4, so for the simple case, ASCII characters, skip the conversion step. */ - if (isascii (*p) && BE (pstr->trans == NULL, 1)) + if (isascii (*p) && __glibc_likely (pstr->trans == NULL)) { memset (&pstr->cur_state, '\0', sizeof (mbstate_t)); /* pstr->valid_len = 0; */ @@ -734,7 +742,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) size_t mbclen; const unsigned char *pp = p; - if (BE (pstr->trans != NULL, 0)) + if (__glibc_unlikely (pstr->trans != NULL)) { int i = mlen < 6 ? mlen : 6; while (--i >= 0) @@ -764,13 +772,13 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) pstr->tip_context = re_string_context_at (pstr, prev_valid_len - 1, eflags); else - pstr->tip_context = ((BE (pstr->word_ops_used != 0, 0) + pstr->tip_context = ((__glibc_unlikely (pstr->word_ops_used != 0) && IS_WIDE_WORD_CHAR (wc)) ? CONTEXT_WORD : ((IS_WIDE_NEWLINE (wc) && pstr->newline_anchor) ? CONTEXT_NEWLINE : 0)); - if (BE (pstr->valid_len, 0)) + if (__glibc_unlikely (pstr->valid_len)) { for (wcs_idx = 0; wcs_idx < pstr->valid_len; ++wcs_idx) pstr->wcs[wcs_idx] = WEOF; @@ -792,7 +800,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) ? CONTEXT_NEWLINE : 0)); } } - if (!BE (pstr->mbs_allocated, 0)) + if (!__glibc_unlikely (pstr->mbs_allocated)) pstr->mbs += offset; } pstr->raw_mbs_idx = idx; @@ -806,7 +814,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) if (pstr->icase) { reg_errcode_t ret = build_wcs_upper_buffer (pstr); - if (BE (ret != REG_NOERROR, 0)) + if (__glibc_unlikely (ret != REG_NOERROR)) return ret; } else @@ -814,7 +822,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) } else #endif /* RE_ENABLE_I18N */ - if (BE (pstr->mbs_allocated, 0)) + if (__glibc_unlikely (pstr->mbs_allocated)) { if (pstr->icase) build_upper_buffer (pstr); @@ -829,14 +837,14 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags) } static unsigned char -internal_function __attribute__ ((pure)) +__attribute__ ((pure)) re_string_peek_byte_case (const re_string_t *pstr, Idx idx) { int ch; Idx off; /* Handle the common (easiest) cases first. */ - if (BE (!pstr->mbs_allocated, 1)) + if (__glibc_likely (!pstr->mbs_allocated)) return re_string_peek_byte (pstr, idx); #ifdef RE_ENABLE_I18N @@ -866,10 +874,9 @@ re_string_peek_byte_case (const re_string_t *pstr, Idx idx) } static unsigned char -internal_function re_string_fetch_byte_case (re_string_t *pstr) { - if (BE (!pstr->mbs_allocated, 1)) + if (__glibc_likely (!pstr->mbs_allocated)) return re_string_fetch_byte (pstr); #ifdef RE_ENABLE_I18N @@ -904,7 +911,6 @@ re_string_fetch_byte_case (re_string_t *pstr) } static void -internal_function re_string_destruct (re_string_t *pstr) { #ifdef RE_ENABLE_I18N @@ -918,15 +924,14 @@ re_string_destruct (re_string_t *pstr) /* Return the context at IDX in INPUT. */ static unsigned int -internal_function re_string_context_at (const re_string_t *input, Idx idx, int eflags) { int c; - if (BE (idx < 0, 0)) + if (__glibc_unlikely (idx < 0)) /* In this case, we use the value stored in input->tip_context, since we can't know the character in input->mbs[-1] here. */ return input->tip_context; - if (BE (idx == input->len, 0)) + if (__glibc_unlikely (idx == input->len)) return ((eflags & REG_NOTEOL) ? CONTEXT_ENDBUF : CONTEXT_NEWLINE | CONTEXT_ENDBUF); #ifdef RE_ENABLE_I18N @@ -945,7 +950,8 @@ re_string_context_at (const re_string_t *input, Idx idx, int eflags) return input->tip_context; } wc = input->wcs[wc_idx]; - if (BE (input->word_ops_used != 0, 0) && IS_WIDE_WORD_CHAR (wc)) + if (__glibc_unlikely (input->word_ops_used != 0) + && IS_WIDE_WORD_CHAR (wc)) return CONTEXT_WORD; return (IS_WIDE_NEWLINE (wc) && input->newline_anchor ? CONTEXT_NEWLINE : 0); @@ -963,25 +969,26 @@ re_string_context_at (const re_string_t *input, Idx idx, int eflags) /* Functions for set operation. */ static reg_errcode_t -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ re_node_set_alloc (re_node_set *set, Idx size) { set->alloc = size; set->nelem = 0; set->elems = re_malloc (Idx, size); - if (BE (set->elems == NULL, 0) && (MALLOC_0_IS_NONNULL || size != 0)) + if (__glibc_unlikely (set->elems == NULL) + && (MALLOC_0_IS_NONNULL || size != 0)) return REG_ESPACE; return REG_NOERROR; } static reg_errcode_t -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ re_node_set_init_1 (re_node_set *set, Idx elem) { set->alloc = 1; set->nelem = 1; set->elems = re_malloc (Idx, 1); - if (BE (set->elems == NULL, 0)) + if (__glibc_unlikely (set->elems == NULL)) { set->alloc = set->nelem = 0; return REG_ESPACE; @@ -991,12 +998,12 @@ re_node_set_init_1 (re_node_set *set, Idx elem) } static reg_errcode_t -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ re_node_set_init_2 (re_node_set *set, Idx elem1, Idx elem2) { set->alloc = 2; set->elems = re_malloc (Idx, 2); - if (BE (set->elems == NULL, 0)) + if (__glibc_unlikely (set->elems == NULL)) return REG_ESPACE; if (elem1 == elem2) { @@ -1021,7 +1028,7 @@ re_node_set_init_2 (re_node_set *set, Idx elem1, Idx elem2) } static reg_errcode_t -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ re_node_set_init_copy (re_node_set *dest, const re_node_set *src) { dest->nelem = src->nelem; @@ -1029,7 +1036,7 @@ re_node_set_init_copy (re_node_set *dest, const re_node_set *src) { dest->alloc = dest->nelem; dest->elems = re_malloc (Idx, dest->alloc); - if (BE (dest->elems == NULL, 0)) + if (__glibc_unlikely (dest->elems == NULL)) { dest->alloc = dest->nelem = 0; return REG_ESPACE; @@ -1046,7 +1053,7 @@ re_node_set_init_copy (re_node_set *dest, const re_node_set *src) Note: We assume dest->elems is NULL, when dest->alloc is 0. */ static reg_errcode_t -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ re_node_set_add_intersect (re_node_set *dest, const re_node_set *src1, const re_node_set *src2) { @@ -1060,7 +1067,7 @@ re_node_set_add_intersect (re_node_set *dest, const re_node_set *src1, { Idx new_alloc = src1->nelem + src2->nelem + dest->alloc; Idx *new_elems = re_realloc (dest->elems, Idx, new_alloc); - if (BE (new_elems == NULL, 0)) + if (__glibc_unlikely (new_elems == NULL)) return REG_ESPACE; dest->elems = new_elems; dest->alloc = new_alloc; @@ -1137,7 +1144,7 @@ re_node_set_add_intersect (re_node_set *dest, const re_node_set *src1, DEST. Return value indicate the error code or REG_NOERROR if succeeded. */ static reg_errcode_t -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ re_node_set_init_union (re_node_set *dest, const re_node_set *src1, const re_node_set *src2) { @@ -1146,7 +1153,7 @@ re_node_set_init_union (re_node_set *dest, const re_node_set *src1, { dest->alloc = src1->nelem + src2->nelem; dest->elems = re_malloc (Idx, dest->alloc); - if (BE (dest->elems == NULL, 0)) + if (__glibc_unlikely (dest->elems == NULL)) return REG_ESPACE; } else @@ -1190,7 +1197,7 @@ re_node_set_init_union (re_node_set *dest, const re_node_set *src1, DEST. Return value indicate the error code or REG_NOERROR if succeeded. */ static reg_errcode_t -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ re_node_set_merge (re_node_set *dest, const re_node_set *src) { Idx is, id, sbase, delta; @@ -1200,13 +1207,13 @@ re_node_set_merge (re_node_set *dest, const re_node_set *src) { Idx new_alloc = 2 * (src->nelem + dest->alloc); Idx *new_buffer = re_realloc (dest->elems, Idx, new_alloc); - if (BE (new_buffer == NULL, 0)) + if (__glibc_unlikely (new_buffer == NULL)) return REG_ESPACE; dest->elems = new_buffer; dest->alloc = new_alloc; } - if (BE (dest->nelem == 0, 0)) + if (__glibc_unlikely (dest->nelem == 0)) { dest->nelem = src->nelem; memcpy (dest->elems, src->elems, src->nelem * sizeof (Idx)); @@ -1273,15 +1280,15 @@ re_node_set_merge (re_node_set *dest, const re_node_set *src) Return true if successful. */ static bool -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ re_node_set_insert (re_node_set *set, Idx elem) { Idx idx; /* In case the set is empty. */ if (set->alloc == 0) - return BE (re_node_set_init_1 (set, elem) == REG_NOERROR, 1); + return __glibc_likely (re_node_set_init_1 (set, elem) == REG_NOERROR); - if (BE (set->nelem, 0) == 0) + if (__glibc_unlikely (set->nelem) == 0) { /* We already guaranteed above that set->alloc != 0. */ set->elems[0] = elem; @@ -1295,7 +1302,7 @@ re_node_set_insert (re_node_set *set, Idx elem) Idx *new_elems; set->alloc = set->alloc * 2; new_elems = re_realloc (set->elems, Idx, set->alloc); - if (BE (new_elems == NULL, 0)) + if (__glibc_unlikely (new_elems == NULL)) return false; set->elems = new_elems; } @@ -1325,7 +1332,7 @@ re_node_set_insert (re_node_set *set, Idx elem) Return true if successful. */ static bool -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ re_node_set_insert_last (re_node_set *set, Idx elem) { /* Realloc if we need. */ @@ -1334,7 +1341,7 @@ re_node_set_insert_last (re_node_set *set, Idx elem) Idx *new_elems; set->alloc = (set->alloc + 1) * 2; new_elems = re_realloc (set->elems, Idx, set->alloc); - if (BE (new_elems == NULL, 0)) + if (__glibc_unlikely (new_elems == NULL)) return false; set->elems = new_elems; } @@ -1348,7 +1355,7 @@ re_node_set_insert_last (re_node_set *set, Idx elem) Return true if SET1 and SET2 are equivalent. */ static bool -internal_function __attribute__ ((pure)) +__attribute__ ((pure)) re_node_set_compare (const re_node_set *set1, const re_node_set *set2) { Idx i; @@ -1363,7 +1370,7 @@ re_node_set_compare (const re_node_set *set1, const re_node_set *set2) /* Return (idx + 1) if SET contains the element ELEM, return 0 otherwise. */ static Idx -internal_function __attribute__ ((pure)) +__attribute__ ((pure)) re_node_set_contains (const re_node_set *set, Idx elem) { __re_size_t idx, right, mid; @@ -1385,7 +1392,6 @@ re_node_set_contains (const re_node_set *set, Idx elem) } static void -internal_function re_node_set_remove_at (re_node_set *set, Idx idx) { if (idx < 0 || idx >= set->nelem) @@ -1400,10 +1406,9 @@ re_node_set_remove_at (re_node_set *set, Idx idx) Or return -1 if an error occurred. */ static Idx -internal_function re_dfa_add_node (re_dfa_t *dfa, re_token_t token) { - if (BE (dfa->nodes_len >= dfa->nodes_alloc, 0)) + if (__glibc_unlikely (dfa->nodes_len >= dfa->nodes_alloc)) { size_t new_nodes_alloc = dfa->nodes_alloc * 2; Idx *new_nexts, *new_indices; @@ -1414,19 +1419,20 @@ re_dfa_add_node (re_dfa_t *dfa, re_token_t token) const size_t max_object_size = MAX (sizeof (re_token_t), MAX (sizeof (re_node_set), sizeof (Idx))); - if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) < new_nodes_alloc, 0)) + if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / max_object_size) + < new_nodes_alloc)) return -1; new_nodes = re_realloc (dfa->nodes, re_token_t, new_nodes_alloc); - if (BE (new_nodes == NULL, 0)) + if (__glibc_unlikely (new_nodes == NULL)) return -1; dfa->nodes = new_nodes; new_nexts = re_realloc (dfa->nexts, Idx, new_nodes_alloc); new_indices = re_realloc (dfa->org_indices, Idx, new_nodes_alloc); new_edests = re_realloc (dfa->edests, re_node_set, new_nodes_alloc); new_eclosures = re_realloc (dfa->eclosures, re_node_set, new_nodes_alloc); - if (BE (new_nexts == NULL || new_indices == NULL - || new_edests == NULL || new_eclosures == NULL, 0)) + if (__glibc_unlikely (new_nexts == NULL || new_indices == NULL + || new_edests == NULL || new_eclosures == NULL)) { re_free (new_nexts); re_free (new_indices); @@ -1454,7 +1460,6 @@ re_dfa_add_node (re_dfa_t *dfa, re_token_t token) } static re_hashval_t -internal_function calc_state_hash (const re_node_set *nodes, unsigned int context) { re_hashval_t hash = nodes->nelem + context; @@ -1474,7 +1479,7 @@ calc_state_hash (const re_node_set *nodes, unsigned int context) optimization. */ static re_dfastate_t * -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ re_acquire_state (reg_errcode_t *err, const re_dfa_t *dfa, const re_node_set *nodes) { @@ -1486,7 +1491,7 @@ re_acquire_state (reg_errcode_t *err, const re_dfa_t *dfa, /* Suppress bogus uninitialized-variable warnings. */ *err = REG_NOERROR; #endif - if (BE (nodes->nelem == 0, 0)) + if (__glibc_unlikely (nodes->nelem == 0)) { *err = REG_NOERROR; return NULL; @@ -1505,7 +1510,7 @@ re_acquire_state (reg_errcode_t *err, const re_dfa_t *dfa, /* There are no appropriate state in the dfa, create the new one. */ new_state = create_ci_newstate (dfa, nodes, hash); - if (BE (new_state == NULL, 0)) + if (__glibc_unlikely (new_state == NULL)) *err = REG_ESPACE; return new_state; @@ -1522,7 +1527,7 @@ re_acquire_state (reg_errcode_t *err, const re_dfa_t *dfa, optimization. */ static re_dfastate_t * -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ re_acquire_state_context (reg_errcode_t *err, const re_dfa_t *dfa, const re_node_set *nodes, unsigned int context) { @@ -1552,7 +1557,7 @@ re_acquire_state_context (reg_errcode_t *err, const re_dfa_t *dfa, } /* There are no appropriate state in 'dfa', create the new one. */ new_state = create_cd_newstate (dfa, nodes, context, hash); - if (BE (new_state == NULL, 0)) + if (__glibc_unlikely (new_state == NULL)) *err = REG_ESPACE; return new_state; @@ -1573,7 +1578,7 @@ register_state (const re_dfa_t *dfa, re_dfastate_t *newstate, newstate->hash = hash; err = re_node_set_alloc (&newstate->non_eps_nodes, newstate->nodes.nelem); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) return REG_ESPACE; for (i = 0; i < newstate->nodes.nelem; i++) { @@ -1584,12 +1589,12 @@ register_state (const re_dfa_t *dfa, re_dfastate_t *newstate, } spot = dfa->state_table + (hash & dfa->state_hash_mask); - if (BE (spot->alloc <= spot->num, 0)) + if (__glibc_unlikely (spot->alloc <= spot->num)) { Idx new_alloc = 2 * spot->num + 2; re_dfastate_t **new_array = re_realloc (spot->array, re_dfastate_t *, new_alloc); - if (BE (new_array == NULL, 0)) + if (__glibc_unlikely (new_array == NULL)) return REG_ESPACE; spot->array = new_array; spot->alloc = new_alloc; @@ -1618,7 +1623,7 @@ free_state (re_dfastate_t *state) Return the new state if succeeded, otherwise return NULL. */ static re_dfastate_t * -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes, re_hashval_t hash) { @@ -1627,10 +1632,10 @@ create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes, re_dfastate_t *newstate; newstate = (re_dfastate_t *) calloc (sizeof (re_dfastate_t), 1); - if (BE (newstate == NULL, 0)) + if (__glibc_unlikely (newstate == NULL)) return NULL; err = re_node_set_init_copy (&newstate->nodes, nodes); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) { re_free (newstate); return NULL; @@ -1656,7 +1661,7 @@ create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes, newstate->has_constraint = 1; } err = register_state (dfa, newstate, hash); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) { free_state (newstate); newstate = NULL; @@ -1668,7 +1673,7 @@ create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes, Return the new state if succeeded, otherwise return NULL. */ static re_dfastate_t * -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes, unsigned int context, re_hashval_t hash) { @@ -1677,10 +1682,10 @@ create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes, re_dfastate_t *newstate; newstate = (re_dfastate_t *) calloc (sizeof (re_dfastate_t), 1); - if (BE (newstate == NULL, 0)) + if (__glibc_unlikely (newstate == NULL)) return NULL; err = re_node_set_init_copy (&newstate->nodes, nodes); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) { re_free (newstate); return NULL; @@ -1712,7 +1717,7 @@ create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes, if (newstate->entrance_nodes == &newstate->nodes) { newstate->entrance_nodes = re_malloc (re_node_set, 1); - if (BE (newstate->entrance_nodes == NULL, 0)) + if (__glibc_unlikely (newstate->entrance_nodes == NULL)) { free_state (newstate); return NULL; @@ -1732,7 +1737,7 @@ create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes, } } err = register_state (dfa, newstate, hash); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) { free_state (newstate); newstate = NULL; diff --git a/gnu/regex_internal.h b/gnu/regex_internal.h index fc4ffdb21fdd76c530ad58656573206203ea0649..a3aedda891518186f1f4e6b6453aa103c1055e4a 100644 --- a/gnu/regex_internal.h +++ b/gnu/regex_internal.h @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -33,13 +33,13 @@ #include #include -#include "intprops.h" +#include #ifdef _LIBC # include # define lock_define(name) __libc_lock_define (, name) # define lock_init(lock) (__libc_lock_init (lock), 0) -# define lock_fini(lock) 0 +# define lock_fini(lock) ((void) 0) # define lock_lock(lock) __libc_lock_lock (lock) # define lock_unlock(lock) __libc_lock_unlock (lock) #elif defined GNULIB_LOCK && !defined USE_UNLOCKED_IO @@ -116,8 +116,6 @@ # define RE_ENABLE_I18N #endif -#define BE(expr, val) __builtin_expect (expr, val) - /* Number of ASCII characters. */ #define ASCII_CHARS 0x80 @@ -133,7 +131,10 @@ /* Rename to standard API for using out of glibc. */ #ifndef _LIBC # undef __wctype +# undef __iswalnum # undef __iswctype +# undef __towlower +# undef __towupper # define __wctype wctype # define __iswalnum iswalnum # define __iswctype iswctype @@ -143,13 +144,8 @@ # define __mbrtowc mbrtowc # define __wcrtomb wcrtomb # define __regfree regfree -# define attribute_hidden #endif /* not _LIBC */ -#if __GNUC__ < 3 + (__GNUC_MINOR__ < 1) -# define __attribute__(arg) -#endif - #ifndef SSIZE_MAX # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) #endif @@ -438,24 +434,9 @@ struct re_dfa_t; typedef struct re_dfa_t re_dfa_t; #ifndef _LIBC -# define internal_function # define IS_IN(libc) false #endif -static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr, - Idx new_buf_len) - internal_function; -#ifdef RE_ENABLE_I18N -static void build_wcs_buffer (re_string_t *pstr) internal_function; -static reg_errcode_t build_wcs_upper_buffer (re_string_t *pstr) - internal_function; -#endif /* RE_ENABLE_I18N */ -static void build_upper_buffer (re_string_t *pstr) internal_function; -static void re_string_translate_buffer (re_string_t *pstr) internal_function; -static unsigned int re_string_context_at (const re_string_t *input, Idx idx, - int eflags) - internal_function __attribute__ ((pure)); - #define re_string_peek_byte(pstr, offset) \ ((pstr)->mbs[(pstr)->cur_idx + offset]) #define re_string_fetch_byte(pstr) \ @@ -761,31 +742,31 @@ typedef struct /* Functions for bitset_t operation. */ -static void +static inline void bitset_set (bitset_t set, Idx i) { set[i / BITSET_WORD_BITS] |= (bitset_word_t) 1 << i % BITSET_WORD_BITS; } -static void +static inline void bitset_clear (bitset_t set, Idx i) { set[i / BITSET_WORD_BITS] &= ~ ((bitset_word_t) 1 << i % BITSET_WORD_BITS); } -static bool +static inline bool bitset_contain (const bitset_t set, Idx i) { return (set[i / BITSET_WORD_BITS] >> i % BITSET_WORD_BITS) & 1; } -static void +static inline void bitset_empty (bitset_t set) { memset (set, '\0', sizeof (bitset_t)); } -static void +static inline void bitset_set_all (bitset_t set) { memset (set, -1, sizeof (bitset_word_t) * (SBC_MAX / BITSET_WORD_BITS)); @@ -794,13 +775,13 @@ bitset_set_all (bitset_t set) ((bitset_word_t) 1 << SBC_MAX % BITSET_WORD_BITS) - 1; } -static void +static inline void bitset_copy (bitset_t dest, const bitset_t src) { memcpy (dest, src, sizeof (bitset_t)); } -static void __attribute__ ((unused)) +static inline void bitset_not (bitset_t set) { int bitset_i; @@ -812,7 +793,7 @@ bitset_not (bitset_t set) & ~set[BITSET_WORDS - 1]); } -static void __attribute__ ((unused)) +static inline void bitset_merge (bitset_t dest, const bitset_t src) { int bitset_i; @@ -820,7 +801,7 @@ bitset_merge (bitset_t dest, const bitset_t src) dest[bitset_i] |= src[bitset_i]; } -static void __attribute__ ((unused)) +static inline void bitset_mask (bitset_t dest, const bitset_t src) { int bitset_i; @@ -831,7 +812,7 @@ bitset_mask (bitset_t dest, const bitset_t src) #ifdef RE_ENABLE_I18N /* Functions for re_string. */ static int -internal_function __attribute__ ((pure, unused)) +__attribute__ ((pure, unused)) re_string_char_size_at (const re_string_t *pstr, Idx idx) { int byte_idx; @@ -844,7 +825,7 @@ re_string_char_size_at (const re_string_t *pstr, Idx idx) } static wint_t -internal_function __attribute__ ((pure, unused)) +__attribute__ ((pure, unused)) re_string_wchar_at (const re_string_t *pstr, Idx idx) { if (pstr->mb_cur_max == 1) @@ -857,7 +838,7 @@ re_string_wchar_at (const re_string_t *pstr, Idx idx) # endif static int -internal_function __attribute__ ((pure, unused)) +__attribute__ ((pure, unused)) re_string_elem_size_at (const re_string_t *pstr, Idx idx) { # ifdef _LIBC @@ -882,23 +863,6 @@ re_string_elem_size_at (const re_string_t *pstr, Idx idx) } #endif /* RE_ENABLE_I18N */ -#ifndef __GNUC_PREREQ -# if defined __GNUC__ && defined __GNUC_MINOR__ -# define __GNUC_PREREQ(maj, min) \ - ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) -# else -# define __GNUC_PREREQ(maj, min) 0 -# endif -#endif - -#if __GNUC_PREREQ (3,4) -# undef __attribute_warn_unused_result__ -# define __attribute_warn_unused_result__ \ - __attribute__ ((__warn_unused_result__)) -#else -# define __attribute_warn_unused_result__ /* empty */ -#endif - #ifndef FALLTHROUGH # if __GNUC__ < 7 # define FALLTHROUGH ((void) 0) diff --git a/gnu/regexec.c b/gnu/regexec.c index 51a5c9ea686e2f7eecc9b52b6cfae5898bac82c8..21cf7915f7c184b0360a1ad8b1061acf09d2ba6b 100644 --- a/gnu/regexec.c +++ b/gnu/regexec.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -18,189 +18,159 @@ . */ static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags, - Idx n) internal_function; -static void match_ctx_clean (re_match_context_t *mctx) internal_function; -static void match_ctx_free (re_match_context_t *cache) internal_function; + Idx n); +static void match_ctx_clean (re_match_context_t *mctx); +static void match_ctx_free (re_match_context_t *cache); static reg_errcode_t match_ctx_add_entry (re_match_context_t *cache, Idx node, - Idx str_idx, Idx from, Idx to) - internal_function; -static Idx search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx) - internal_function; + Idx str_idx, Idx from, Idx to); +static Idx search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx); static reg_errcode_t match_ctx_add_subtop (re_match_context_t *mctx, Idx node, - Idx str_idx) internal_function; + Idx str_idx); static re_sub_match_last_t * match_ctx_add_sublast (re_sub_match_top_t *subtop, - Idx node, Idx str_idx) - internal_function; + Idx node, Idx str_idx); static void sift_ctx_init (re_sift_context_t *sctx, re_dfastate_t **sifted_sts, re_dfastate_t **limited_sts, Idx last_node, - Idx last_str_idx) - internal_function; + Idx last_str_idx); static reg_errcode_t re_search_internal (const regex_t *preg, const char *string, Idx length, Idx start, Idx last_start, Idx stop, size_t nmatch, regmatch_t pmatch[], - int eflags) internal_function; + int eflags); static regoff_t re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1, Idx length1, const char *string2, Idx length2, Idx start, regoff_t range, struct re_registers *regs, - Idx stop, bool ret_len) internal_function; + Idx stop, bool ret_len); static regoff_t re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length, Idx start, regoff_t range, Idx stop, struct re_registers *regs, - bool ret_len) internal_function; + bool ret_len); static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, - Idx nregs, int regs_allocated) internal_function; -static reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx) - internal_function; + Idx nregs, int regs_allocated); +static reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx); static Idx check_matching (re_match_context_t *mctx, bool fl_longest_match, - Idx *p_match_first) internal_function; + Idx *p_match_first); static Idx check_halt_state_context (const re_match_context_t *mctx, - const re_dfastate_t *state, Idx idx) - internal_function; + const re_dfastate_t *state, Idx idx); static void update_regs (const re_dfa_t *dfa, regmatch_t *pmatch, regmatch_t *prev_idx_match, Idx cur_node, - Idx cur_idx, Idx nmatch) internal_function; + Idx cur_idx, Idx nmatch); static reg_errcode_t push_fail_stack (struct re_fail_stack_t *fs, Idx str_idx, Idx dest_node, Idx nregs, regmatch_t *regs, - re_node_set *eps_via_nodes) - internal_function; + re_node_set *eps_via_nodes); static reg_errcode_t set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch, regmatch_t *pmatch, - bool fl_backtrack) internal_function; -static reg_errcode_t free_fail_stack_return (struct re_fail_stack_t *fs) - internal_function; + bool fl_backtrack); +static reg_errcode_t free_fail_stack_return (struct re_fail_stack_t *fs); #ifdef RE_ENABLE_I18N static int sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx, - Idx node_idx, Idx str_idx, Idx max_str_idx) - internal_function; + Idx node_idx, Idx str_idx, Idx max_str_idx); #endif /* RE_ENABLE_I18N */ static reg_errcode_t sift_states_backward (const re_match_context_t *mctx, - re_sift_context_t *sctx) - internal_function; + re_sift_context_t *sctx); static reg_errcode_t build_sifted_states (const re_match_context_t *mctx, re_sift_context_t *sctx, Idx str_idx, - re_node_set *cur_dest) - internal_function; + re_node_set *cur_dest); static reg_errcode_t update_cur_sifted_state (const re_match_context_t *mctx, re_sift_context_t *sctx, Idx str_idx, - re_node_set *dest_nodes) - internal_function; + re_node_set *dest_nodes); static reg_errcode_t add_epsilon_src_nodes (const re_dfa_t *dfa, re_node_set *dest_nodes, - const re_node_set *candidates) - internal_function; + const re_node_set *candidates); static bool check_dst_limits (const re_match_context_t *mctx, const re_node_set *limits, Idx dst_node, Idx dst_idx, Idx src_node, - Idx src_idx) internal_function; + Idx src_idx); static int check_dst_limits_calc_pos_1 (const re_match_context_t *mctx, int boundaries, Idx subexp_idx, - Idx from_node, Idx bkref_idx) - internal_function; + Idx from_node, Idx bkref_idx); static int check_dst_limits_calc_pos (const re_match_context_t *mctx, Idx limit, Idx subexp_idx, Idx node, Idx str_idx, - Idx bkref_idx) internal_function; + Idx bkref_idx); static reg_errcode_t check_subexp_limits (const re_dfa_t *dfa, re_node_set *dest_nodes, const re_node_set *candidates, re_node_set *limits, struct re_backref_cache_entry *bkref_ents, - Idx str_idx) internal_function; + Idx str_idx); static reg_errcode_t sift_states_bkref (const re_match_context_t *mctx, re_sift_context_t *sctx, - Idx str_idx, const re_node_set *candidates) - internal_function; + Idx str_idx, const re_node_set *candidates); static reg_errcode_t merge_state_array (const re_dfa_t *dfa, re_dfastate_t **dst, - re_dfastate_t **src, Idx num) - internal_function; + re_dfastate_t **src, Idx num); static re_dfastate_t *find_recover_state (reg_errcode_t *err, - re_match_context_t *mctx) internal_function; + re_match_context_t *mctx); static re_dfastate_t *transit_state (reg_errcode_t *err, re_match_context_t *mctx, - re_dfastate_t *state) internal_function; + re_dfastate_t *state); static re_dfastate_t *merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx, - re_dfastate_t *next_state) - internal_function; + re_dfastate_t *next_state); static reg_errcode_t check_subexp_matching_top (re_match_context_t *mctx, re_node_set *cur_nodes, - Idx str_idx) internal_function; + Idx str_idx); #if 0 static re_dfastate_t *transit_state_sb (reg_errcode_t *err, re_match_context_t *mctx, - re_dfastate_t *pstate) - internal_function; + re_dfastate_t *pstate); #endif #ifdef RE_ENABLE_I18N static reg_errcode_t transit_state_mb (re_match_context_t *mctx, - re_dfastate_t *pstate) - internal_function; + re_dfastate_t *pstate); #endif /* RE_ENABLE_I18N */ static reg_errcode_t transit_state_bkref (re_match_context_t *mctx, - const re_node_set *nodes) - internal_function; + const re_node_set *nodes); static reg_errcode_t get_subexp (re_match_context_t *mctx, - Idx bkref_node, Idx bkref_str_idx) - internal_function; + Idx bkref_node, Idx bkref_str_idx); static reg_errcode_t get_subexp_sub (re_match_context_t *mctx, const re_sub_match_top_t *sub_top, re_sub_match_last_t *sub_last, - Idx bkref_node, Idx bkref_str) - internal_function; + Idx bkref_node, Idx bkref_str); static Idx find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes, - Idx subexp_idx, int type) internal_function; + Idx subexp_idx, int type); static reg_errcode_t check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node, Idx top_str, Idx last_node, Idx last_str, - int type) internal_function; + int type); static reg_errcode_t check_arrival_add_next_nodes (re_match_context_t *mctx, Idx str_idx, re_node_set *cur_nodes, - re_node_set *next_nodes) - internal_function; + re_node_set *next_nodes); static reg_errcode_t check_arrival_expand_ecl (const re_dfa_t *dfa, re_node_set *cur_nodes, - Idx ex_subexp, int type) - internal_function; + Idx ex_subexp, int type); static reg_errcode_t check_arrival_expand_ecl_sub (const re_dfa_t *dfa, re_node_set *dst_nodes, Idx target, Idx ex_subexp, - int type) internal_function; + int type); static reg_errcode_t expand_bkref_cache (re_match_context_t *mctx, re_node_set *cur_nodes, Idx cur_str, - Idx subexp_num, int type) - internal_function; -static bool build_trtable (const re_dfa_t *dfa, - re_dfastate_t *state) internal_function; + Idx subexp_num, int type); +static bool build_trtable (const re_dfa_t *dfa, re_dfastate_t *state); #ifdef RE_ENABLE_I18N static int check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx, - const re_string_t *input, Idx idx) - internal_function; + const re_string_t *input, Idx idx); # ifdef _LIBC static unsigned int find_collation_sequence_value (const unsigned char *mbs, - size_t name_len) - internal_function; + size_t name_len); # endif /* _LIBC */ #endif /* RE_ENABLE_I18N */ static Idx group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state, re_node_set *states_node, - bitset_t *states_ch) internal_function; + bitset_t *states_ch); static bool check_node_accept (const re_match_context_t *mctx, - const re_token_t *node, Idx idx) - internal_function; -static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len) - internal_function; + const re_token_t *node, Idx idx); +static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len); /* Entry point for POSIX code. */ @@ -219,7 +189,7 @@ static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len) We return 0 if we find a match and REG_NOMATCH if not. */ int -regexec (const regex_t *_Restrict_ preg, const char *_Restrict_ string, +regexec (const regex_t *__restrict preg, const char *__restrict string, size_t nmatch, regmatch_t pmatch[], int eflags) { reg_errcode_t err; @@ -252,6 +222,8 @@ regexec (const regex_t *_Restrict_ preg, const char *_Restrict_ string, } #ifdef _LIBC +libc_hidden_def (__regexec) + # include versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4); @@ -260,8 +232,8 @@ __typeof__ (__regexec) __compat_regexec; int attribute_compat_text_section -__compat_regexec (const regex_t *_Restrict_ preg, - const char *_Restrict_ string, size_t nmatch, +__compat_regexec (const regex_t *__restrict preg, + const char *__restrict string, size_t nmatch, regmatch_t pmatch[], int eflags) { return regexec (preg, string, nmatch, pmatch, @@ -346,7 +318,6 @@ weak_alias (__re_search_2, re_search_2) #endif static regoff_t -internal_function re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1, Idx length1, const char *string2, Idx length2, Idx start, regoff_t range, struct re_registers *regs, @@ -357,9 +328,8 @@ re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1, Idx len; char *s = NULL; - if (BE ((length1 < 0 || length2 < 0 || stop < 0 - || INT_ADD_WRAPV (length1, length2, &len)), - 0)) + if (__glibc_unlikely ((length1 < 0 || length2 < 0 || stop < 0 + || INT_ADD_WRAPV (length1, length2, &len)))) return -2; /* Concatenate the strings. */ @@ -368,7 +338,7 @@ re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1, { s = re_malloc (char, len); - if (BE (s == NULL, 0)) + if (__glibc_unlikely (s == NULL)) return -2; #ifdef _LIBC memcpy (__mempcpy (s, string1, length1), string2, length2); @@ -395,7 +365,6 @@ re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1, otherwise the position of the match is returned. */ static regoff_t -internal_function re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length, Idx start, regoff_t range, Idx stop, struct re_registers *regs, bool ret_len) @@ -409,11 +378,13 @@ re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length, Idx last_start = start + range; /* Check for out-of-range. */ - if (BE (start < 0 || start > length, 0)) + if (__glibc_unlikely (start < 0 || start > length)) return -1; - if (BE (length < last_start || (0 <= range && last_start < start), 0)) + if (__glibc_unlikely (length < last_start + || (0 <= range && last_start < start))) last_start = length; - else if (BE (last_start < 0 || (range < 0 && start <= last_start), 0)) + else if (__glibc_unlikely (last_start < 0 + || (range < 0 && start <= last_start))) last_start = 0; lock_lock (dfa->lock); @@ -425,17 +396,17 @@ re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length, if (start < last_start && bufp->fastmap != NULL && !bufp->fastmap_accurate) re_compile_fastmap (bufp); - if (BE (bufp->no_sub, 0)) + if (__glibc_unlikely (bufp->no_sub)) regs = NULL; /* We need at least 1 register. */ if (regs == NULL) nregs = 1; - else if (BE (bufp->regs_allocated == REGS_FIXED - && regs->num_regs <= bufp->re_nsub, 0)) + else if (__glibc_unlikely (bufp->regs_allocated == REGS_FIXED + && regs->num_regs <= bufp->re_nsub)) { nregs = regs->num_regs; - if (BE (nregs < 1, 0)) + if (__glibc_unlikely (nregs < 1)) { /* Nothing can be copied to regs. */ regs = NULL; @@ -445,7 +416,7 @@ re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length, else nregs = bufp->re_nsub + 1; pmatch = re_malloc (regmatch_t, nregs); - if (BE (pmatch == NULL, 0)) + if (__glibc_unlikely (pmatch == NULL)) { rval = -2; goto out; @@ -464,11 +435,11 @@ re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length, /* If caller wants register contents data back, copy them. */ bufp->regs_allocated = re_copy_regs (regs, pmatch, nregs, bufp->regs_allocated); - if (BE (bufp->regs_allocated == REGS_UNALLOCATED, 0)) + if (__glibc_unlikely (bufp->regs_allocated == REGS_UNALLOCATED)) rval = -2; } - if (BE (rval == 0, 1)) + if (__glibc_likely (rval == 0)) { if (ret_len) { @@ -485,7 +456,6 @@ re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length, } static unsigned -internal_function re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, Idx nregs, int regs_allocated) { @@ -499,10 +469,10 @@ re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, Idx nregs, if (regs_allocated == REGS_UNALLOCATED) { /* No. So allocate them with malloc. */ regs->start = re_malloc (regoff_t, need_regs); - if (BE (regs->start == NULL, 0)) + if (__glibc_unlikely (regs->start == NULL)) return REGS_UNALLOCATED; regs->end = re_malloc (regoff_t, need_regs); - if (BE (regs->end == NULL, 0)) + if (__glibc_unlikely (regs->end == NULL)) { re_free (regs->start); return REGS_UNALLOCATED; @@ -513,14 +483,14 @@ re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, Idx nregs, { /* Yes. If we need more elements than were already allocated, reallocate them. If we need fewer, just leave it alone. */ - if (BE (need_regs > regs->num_regs, 0)) + if (__glibc_unlikely (need_regs > regs->num_regs)) { regoff_t *new_start = re_realloc (regs->start, regoff_t, need_regs); regoff_t *new_end; - if (BE (new_start == NULL, 0)) + if (__glibc_unlikely (new_start == NULL)) return REGS_UNALLOCATED; new_end = re_realloc (regs->end, regoff_t, need_regs); - if (BE (new_end == NULL, 0)) + if (__glibc_unlikely (new_end == NULL)) { re_free (new_start); return REGS_UNALLOCATED; @@ -611,7 +581,7 @@ re_exec (const char *s) (0 <= LAST_START && LAST_START <= LENGTH) */ static reg_errcode_t -__attribute_warn_unused_result__ internal_function +__attribute_warn_unused_result__ re_search_internal (const regex_t *preg, const char *string, Idx length, Idx start, Idx last_start, Idx stop, size_t nmatch, regmatch_t pmatch[], int eflags) @@ -646,9 +616,10 @@ re_search_internal (const regex_t *preg, const char *string, Idx length, nmatch -= extra_nmatch; /* Check if the DFA haven't been compiled. */ - if (BE (preg->used == 0 || dfa->init_state == NULL - || dfa->init_state_word == NULL || dfa->init_state_nl == NULL - || dfa->init_state_begbuf == NULL, 0)) + if (__glibc_unlikely (preg->used == 0 || dfa->init_state == NULL + || dfa->init_state_word == NULL + || dfa->init_state_nl == NULL + || dfa->init_state_begbuf == NULL)) return REG_NOMATCH; #ifdef DEBUG @@ -675,14 +646,14 @@ re_search_internal (const regex_t *preg, const char *string, Idx length, err = re_string_allocate (&mctx.input, string, length, dfa->nodes_len + 1, preg->translate, (preg->syntax & RE_ICASE) != 0, dfa); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) goto free_return; mctx.input.stop = stop; mctx.input.raw_stop = stop; mctx.input.newline_anchor = preg->newline_anchor; err = match_ctx_init (&mctx, eflags, dfa->nbackref * 2); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) goto free_return; /* We will log all the DFA states through which the dfa pass, @@ -692,15 +663,15 @@ re_search_internal (const regex_t *preg, const char *string, Idx length, if (nmatch > 1 || dfa->has_mb_node) { /* Avoid overflow. */ - if (BE ((MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) - <= mctx.input.bufs_len), 0)) + if (__glibc_unlikely ((MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) + <= mctx.input.bufs_len))) { err = REG_ESPACE; goto free_return; } mctx.state_log = re_malloc (re_dfastate_t *, mctx.input.bufs_len + 1); - if (BE (mctx.state_log == NULL, 0)) + if (__glibc_unlikely (mctx.state_log == NULL)) { err = REG_ESPACE; goto free_return; @@ -744,19 +715,19 @@ re_search_internal (const regex_t *preg, const char *string, Idx length, case 7: /* Fastmap with single-byte translation, match forward. */ - while (BE (match_first < right_lim, 1) + while (__glibc_likely (match_first < right_lim) && !fastmap[t[(unsigned char) string[match_first]]]) ++match_first; goto forward_match_found_start_or_reached_end; case 6: /* Fastmap without translation, match forward. */ - while (BE (match_first < right_lim, 1) + while (__glibc_likely (match_first < right_lim) && !fastmap[(unsigned char) string[match_first]]) ++match_first; forward_match_found_start_or_reached_end: - if (BE (match_first == right_lim, 0)) + if (__glibc_unlikely (match_first == right_lim)) { ch = match_first >= length ? 0 : (unsigned char) string[match_first]; @@ -789,11 +760,12 @@ re_search_internal (const regex_t *preg, const char *string, Idx length, /* If MATCH_FIRST is out of the valid range, reconstruct the buffers. */ __re_size_t offset = match_first - mctx.input.raw_mbs_idx; - if (BE (offset >= (__re_size_t) mctx.input.valid_raw_len, 0)) + if (__glibc_unlikely (offset + >= (__re_size_t) mctx.input.valid_raw_len)) { err = re_string_reconstruct (&mctx.input, match_first, eflags); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) goto free_return; offset = match_first - mctx.input.raw_mbs_idx; @@ -817,7 +789,7 @@ re_search_internal (const regex_t *preg, const char *string, Idx length, /* Reconstruct the buffers so that the matcher can assume that the matching starts from the beginning of the buffer. */ err = re_string_reconstruct (&mctx.input, match_first, eflags); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) goto free_return; #ifdef RE_ENABLE_I18N @@ -834,7 +806,7 @@ re_search_internal (const regex_t *preg, const char *string, Idx length, start <= last_start ? &match_first : NULL); if (match_last != -1) { - if (BE (match_last == -2, 0)) + if (__glibc_unlikely (match_last == -2)) { err = REG_ESPACE; goto free_return; @@ -854,7 +826,7 @@ re_search_internal (const regex_t *preg, const char *string, Idx length, err = prune_impossible_nodes (&mctx); if (err == REG_NOERROR) break; - if (BE (err != REG_NOMATCH, 0)) + if (__glibc_unlikely (err != REG_NOMATCH)) goto free_return; match_last = -1; } @@ -891,7 +863,7 @@ re_search_internal (const regex_t *preg, const char *string, Idx length, { err = set_regs (preg, &mctx, nmatch, pmatch, dfa->has_plural_match && dfa->nbackref > 0); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) goto free_return; } @@ -902,7 +874,7 @@ re_search_internal (const regex_t *preg, const char *string, Idx length, if (pmatch[reg_idx].rm_so != -1) { #ifdef RE_ENABLE_I18N - if (BE (mctx.input.offsets_needed != 0, 0)) + if (__glibc_unlikely (mctx.input.offsets_needed != 0)) { pmatch[reg_idx].rm_so = (pmatch[reg_idx].rm_so == mctx.input.valid_len @@ -945,7 +917,7 @@ re_search_internal (const regex_t *preg, const char *string, Idx length, } static reg_errcode_t -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ prune_impossible_nodes (re_match_context_t *mctx) { const re_dfa_t *const dfa = mctx->dfa; @@ -961,11 +933,12 @@ prune_impossible_nodes (re_match_context_t *mctx) halt_node = mctx->last_node; /* Avoid overflow. */ - if (BE (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) <= match_last, 0)) + if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) + <= match_last)) return REG_ESPACE; sifted_states = re_malloc (re_dfastate_t *, match_last + 1); - if (BE (sifted_states == NULL, 0)) + if (__glibc_unlikely (sifted_states == NULL)) { ret = REG_ESPACE; goto free_return; @@ -973,7 +946,7 @@ prune_impossible_nodes (re_match_context_t *mctx) if (dfa->nbackref) { lim_states = re_malloc (re_dfastate_t *, match_last + 1); - if (BE (lim_states == NULL, 0)) + if (__glibc_unlikely (lim_states == NULL)) { ret = REG_ESPACE; goto free_return; @@ -986,7 +959,7 @@ prune_impossible_nodes (re_match_context_t *mctx) match_last); ret = sift_states_backward (mctx, &sctx); re_node_set_free (&sctx.limits); - if (BE (ret != REG_NOERROR, 0)) + if (__glibc_unlikely (ret != REG_NOERROR)) goto free_return; if (sifted_states[0] != NULL || lim_states[0] != NULL) break; @@ -1008,7 +981,7 @@ prune_impossible_nodes (re_match_context_t *mctx) match_last + 1); re_free (lim_states); lim_states = NULL; - if (BE (ret != REG_NOERROR, 0)) + if (__glibc_unlikely (ret != REG_NOERROR)) goto free_return; } else @@ -1016,7 +989,7 @@ prune_impossible_nodes (re_match_context_t *mctx) sift_ctx_init (&sctx, sifted_states, lim_states, halt_node, match_last); ret = sift_states_backward (mctx, &sctx); re_node_set_free (&sctx.limits); - if (BE (ret != REG_NOERROR, 0)) + if (__glibc_unlikely (ret != REG_NOERROR)) goto free_return; if (sifted_states[0] == NULL) { @@ -1041,7 +1014,7 @@ prune_impossible_nodes (re_match_context_t *mctx) since initial states may have constraints like "\<", "^", etc.. */ static inline re_dfastate_t * -__attribute__ ((always_inline)) internal_function +__attribute__ ((always_inline)) acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx, Idx idx) { @@ -1083,7 +1056,7 @@ acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx, index of the buffer. */ static Idx -internal_function __attribute_warn_unused_result__ +__attribute_warn_unused_result__ check_matching (re_match_context_t *mctx, bool fl_longest_match, Idx *p_match_first) { @@ -1099,7 +1072,7 @@ check_matching (re_match_context_t *mctx, bool fl_longest_match, err = REG_NOERROR; cur_state = acquire_init_state_context (&err, mctx, cur_str_idx); /* An initial state must not be NULL (invalid). */ - if (BE (cur_state == NULL, 0)) + if (__glibc_unlikely (cur_state == NULL)) { assert (err == REG_ESPACE); return -2; @@ -1111,24 +1084,24 @@ check_matching (re_match_context_t *mctx, bool fl_longest_match, /* Check OP_OPEN_SUBEXP in the initial state in case that we use them later. E.g. Processing back references. */ - if (BE (dfa->nbackref, 0)) + if (__glibc_unlikely (dfa->nbackref)) { at_init_state = false; err = check_subexp_matching_top (mctx, &cur_state->nodes, 0); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) return err; if (cur_state->has_backref) { err = transit_state_bkref (mctx, &cur_state->nodes); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) return err; } } } /* If the RE accepts NULL string. */ - if (BE (cur_state->halt, 0)) + if (__glibc_unlikely (cur_state->halt)) { if (!cur_state->has_constraint || check_halt_state_context (mctx, cur_state, cur_str_idx)) @@ -1148,13 +1121,13 @@ check_matching (re_match_context_t *mctx, bool fl_longest_match, re_dfastate_t *old_state = cur_state; Idx next_char_idx = re_string_cur_idx (&mctx->input) + 1; - if ((BE (next_char_idx >= mctx->input.bufs_len, 0) + if ((__glibc_unlikely (next_char_idx >= mctx->input.bufs_len) && mctx->input.bufs_len < mctx->input.len) - || (BE (next_char_idx >= mctx->input.valid_len, 0) + || (__glibc_unlikely (next_char_idx >= mctx->input.valid_len) && mctx->input.valid_len < mctx->input.len)) { err = extend_buffers (mctx, next_char_idx + 1); - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) { assert (err == REG_ESPACE); return -2; @@ -1170,7 +1143,7 @@ check_matching (re_match_context_t *mctx, bool fl_longest_match, /* Reached the invalid state or an error. Try to recover a valid state using the state log, if available and if we have not already found a valid (even if not the longest) match. */ - if (BE (err != REG_NOERROR, 0)) + if (__glibc_unlikely (err != REG_NOERROR)) return -2; if (mctx->state_log == NULL @@ -1179,7 +1152,7 @@ check_matching (re_match_context_t *mctx, bool fl_longest_match, break; } - if (BE (at_init_state, 0)) + if (__glibc_unlikely (at_init_state)) { if (old_state == cur_state) next_start_idx = next_char_idx; @@ -1216,7 +1189,6 @@ check_matching (re_match_context_t *mctx, bool fl_longest_match, /* Check NODE match the current context. */ static bool -internal_function check_halt_node_context (const re_dfa_t *dfa, Idx node, unsigned int context) { re_token_type_t type = dfa->nodes[node].type; @@ -1235,7 +1207,6 @@ check_halt_node_context (const re_dfa_t *dfa, Idx node, unsigned int context) match the context, return the node. */ static Idx -internal_function check_halt_state_context (const re_match_context_t *mctx, const re_dfastate_t *state, Idx idx) { @@ -1257,7 +1228,6 @@ check_halt_state_context (const re_match_context_t *mctx, return -1 in case of errors. */ static Idx -internal_function proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs, Idx *pidx, Idx node, re_node_set *eps_via_nodes, struct re_fail_stack_t *fs) @@ -1271,7 +1241,7 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs, re_node_set *edests = &dfa->edests[node]; Idx dest_node; ok = re_node_set_insert (eps_via_nodes, node); - if (BE (! ok, 0)) + if (__glibc_unlikely (! ok)) return -2; /* Pick up a valid destination, or return -1 if none is found. */ @@ -1333,7 +1303,7 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs, { Idx dest_node; ok = re_node_set_insert (eps_via_nodes, node); - if (BE (! ok, 0)) + if (__glibc_unlikely (! ok)) return -2; dest_node = dfa->edests[node].elems[0]; if (re_node_set_contains (&mctx->state_log[*pidx]->nodes, @@ -1359,7 +1329,7 @@ procee