Paul Eggert [Mon, 2 May 2022 16:52:48 +0000 (09:52 -0700)]
gettime-res: help the compiler
* lib/gettime-res.c (gettime_res): Pacify GCC versions that
incorrectly complain about earlier.tv_sec not being initialized.
Let GCC know that gcd args are always positive.
Paul Eggert [Mon, 2 May 2022 16:01:08 +0000 (09:01 -0700)]
af_alg: port to Ubuntu 22.04
Without this patch, maintainer builds of coreutils fail on Ubuntu
22.04 with diagnostics like "./lib/gl_openssl.h:79:1: error:
'MD5_Init' is deprecated: Since OpenSSL 3.0
[-Werror=deprecated-declarations]". From
<https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes>
it appears that Gnulib needs to either define OPENSSL_API_COMPAT
to a version less than 3.0, or use a compatibility layer, or
assume OpenSSL 1.1.0 or later. The simplest workaround is to
define OPENSSL_API_COMPAT for 1.1.1, the oldest OpenSSL release
still supported. A better fix would be to rewrite the code to
assume OpenSSL 1.1.1 or later, and stop using the older API.
* lib/md5.h, lib/sha1.h, lib/sha256.h, lib/sha512.h, lib/sm3.h:
Define OPENSSL_API_COMPAT to 0x10101000L to suppress
the deprecation warnings on Ubuntu 22.04.
Bruno Haible [Sat, 30 Apr 2022 12:09:00 +0000 (14:09 +0200)]
string: Avoid syntax error on glibc systems with GCC 11.
Reported by Tom Tromey <tromey@adacore.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-04/msg00075.html>
and by Satadru Pramanik <satadru@umich.edu> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-04/msg00076.html>.
* lib/string.in.h (strndup): Don't rededeclare strndup if it is defined
as a macro.
Paul Eggert [Thu, 28 Apr 2022 21:40:48 +0000 (14:40 -0700)]
glob: improve config and test cleanup
Config problem reported by Benno Schulenberg in:
https://lists.gnu.org/r/bug-gnulib/2022-04/msg00071.html
* m4/glob.m4 (gl_GLOB): Clean up temporary file.
Also, name it conf$$-file not conf-file, so it’s cleaned
up on interrupt.
* modules/glob-tests (MOSTLYCLEANFILES):
Append test-glob.tglobfile, test-glob.tgloblink[123].
Paul Eggert [Tue, 26 Apr 2022 21:54:26 +0000 (14:54 -0700)]
glob: port to NetBSD 9.2
Problem reported by Benno Schulenberg in:
https://lists.gnu.org/r/bug-gnulib/2022-04/msg00052.html
* doc/posix-functions/dirfd.texi: Document NetBSD 9.2 portability
bugs. Remove an old common about errno that is no longer true
of POSIX 2018.
* lib/glob.c (glob_in_dir): Convert dirfd arg from void *
to DIR * before passing it to dirfd.
Paul Eggert [Fri, 22 Apr 2022 01:56:12 +0000 (18:56 -0700)]
regex: match [...---...] like V7 grep
Problem reported by Arnold Robbins in:
https://bugs.gnu.org/20657
https://lists.gnu.org/r/bug-gnulib/2022-04/msg00053.html
* lib/regcomp.c (peek_token_bracket): Let [...---...] match '-'.
This is an extension to POSIX, and matches V7 Unix grep.
Paul Eggert [Thu, 21 Apr 2022 02:34:57 +0000 (19:34 -0700)]
backupfile: fix bug when renaming simple backups
* lib/backupfile.c (backupfile_internal): Fix bug when RENAME
and when doing simple backups. Problem reported by Steve Ward in:
https://bugs.gnu.org/55029
Paul Eggert [Wed, 20 Apr 2022 17:42:51 +0000 (10:42 -0700)]
gettime-res: more-robust sampling
* lib/gettime-res.c (gettime_res): If adjacent timestamps are
identical search for a differing timestamp. Also, stop collecting
samples thereafter since they surely won’t help.
Paul Eggert [Sun, 17 Apr 2022 02:18:03 +0000 (19:18 -0700)]
verify: port to Mac OS 10.7.5
Mac OS 10.7.5 clang sets __clang_major__ to 4 even though it was
derived from Clang 3.2. Problem reported by Werner Lemberg in:
https://lists.gnu.org/r/emacs-devel/2022-04/msg00779.html
* lib/verify.h (_GL_HAVE__STATIC_ASSERT): Don’t define to 1
when __clang_major__ == 4 && !__cplusplus
&& __STDC_VERSION__ < 201112L && !defined __STRICT_ANSI__.
Bruno Haible [Wed, 13 Apr 2022 22:29:04 +0000 (00:29 +0200)]
string: Fix errors in C++ mode on glibc systems with clang.
* lib/string.in.h (memchr, memrchr, rawmemchr, strchrnul, strpbrk,
strstr, strcasestr): Use _GL_CXXALIASWARN1 also with clang, and add
exception specification.
Bruno Haible [Wed, 13 Apr 2022 21:43:05 +0000 (23:43 +0200)]
math: Fix errors in C++ mode on glibc systems with clang.
* lib/math.in.h (GNULIB_NAMESPACE_LACKS_ISFINITE,
GNULIB_NAMESPACE_LACKS_ISINF, GNULIB_NAMESPACE_LACKS_ISNAN,
GNULIB_NAMESPACE_LACKS_SIGNBIT): New macros.
* tests/test-math-c++.cc (isfinite): Skip test if
GNULIB_NAMESPACE_LACKS_ISFINITE is 1.
(isinf): Skip test if GNULIB_NAMESPACE_LACKS_ISINF is 1.
(isnan): Skip test if GNULIB_NAMESPACE_LACKS_ISNAN is 1.
(signbit): Skip test if GNULIB_NAMESPACE_LACKS_SIGNBIT is 1.
Paul Eggert [Mon, 4 Apr 2022 17:53:12 +0000 (10:53 -0700)]
init.sh: don’t assume gzip
* tests/init.sh (rand_bytes_): Don’t assume gzip is installed.
I found this while testing gzip installation on a platform where I
had removed the installed gzip. gzip is executed only on
platforms lacking mktemp and /dev/urandom so this code is rarely
used; however, these platforms might also lack gzip since gzip
is neither specified by POSIX or required by the GNU Coding Standards.
Paul Eggert [Wed, 23 Mar 2022 17:22:51 +0000 (10:22 -0700)]
glob: test for glibc bug 25659
https://sourceware.org/bugzilla/show_bug.cgi?id=25659
* m4/glob.m4 (gl_GLOB): Replace glob if it has bug 25659.
* tests/test-glob.c (main): Test for glibc bug 25659.
Paul Eggert [Wed, 23 Mar 2022 16:52:58 +0000 (09:52 -0700)]
glob: fix symlink and // issues; improve speed
* lib/glob.c: Include fcntl.h.
(dirfd) [_LIBC]: New macro.
(GLOB_STAT64, GLOB_LSTAT64): Remove. Replace all uses with ...
(GLOB_FSTATAT64): ... this new macro.
(glob_in_dir): Treat DT_LNK like DT_UNKNOWN.
Use directory-relative fstatat unless GLOB_ALTDIRFUNC, or dirfd fails.
Avoid duplicate strlen (directory).
Work even if directory is "/", without turning it into "//".
Use a scratch buffer instead of by-hand alloca stuff.
Use mempcpy and memcpy instead of stpcpy and strcpy.
* modules/glob (Depends-on): Add dirfd, fstatat. Remove stat.
(License): Change from LGPLv2+ to GPL, since it depends on
fstatat.
DJ Delorie [Wed, 23 Mar 2022 16:39:37 +0000 (09:39 -0700)]
glob: resolve DT_UNKNOWN via is_dir
The DT_* values returned by getdents (readdir) are only hints and
not required. In fact, some Linux filesystems return DT_UNKNOWN
for most entries, regardless of actual type. This causes make
to mis-match patterns with a trailing slash (via GLOB_ONLYDIR)
(see make's functions/wildcard test case). Thus, this patch
detects that case and uses is_dir() to make the type known enough
for proper operation.
Performance in non-DT_UNKNOWN cases is not affected.
The lack of DT_* is a well known issue on older XFS installations
(for example, RHEL 7 and 8, Fedora 28) but can be recreated by
creating an XFS filesystem with flags that mimic older behavior:
Based on patch by Darshit Shah in:
https://lists.gnu.org/archive/html/bug-gnulib/2022-03/msg00022.html
* build-aux/announce-gen (usage): Add --gpg-key-email and
--gpg-keyring-url.
(main): Support the new options.
(main): Don't suggest 'gpg --keyserver' since the situation with
public key servers is complicated and GnuPG version dependent.
Paul Eggert [Fri, 11 Mar 2022 21:27:33 +0000 (13:27 -0800)]
regex: fix free_fail_stack undefined behavior
* lib/regexec.c (push_fail_stack): Don’t increment number of
re_fail_stack_t entries until after successful allocation. This
prevents a crash if re_realloc or re_malloc fails here, and a
later free_fail_stack examines regs or a later pop_fail_stack
examines node. Problem discovered by Coverity scan sent
2022-03-11 11:03:52Z.
Paul Eggert [Wed, 9 Mar 2022 21:54:53 +0000 (13:54 -0800)]
statat: now obsolete
* lib/openat.h (statat, lstatat): Now deprecated.
All uses removed, and replaced with fstatat.
* modules/statat: Mark as obsolete, because it’s confusing:
it’s not clear whether it should use AT_NO_AUTOMOUNT,
which is implied by stat and by lstat, but not by fstatat.
* tests/test-statat.c: Disable deprecated-declarations warnings.
Paul Eggert [Wed, 9 Mar 2022 19:54:13 +0000 (11:54 -0800)]
fts: be consistent about AT_NO_AUTOMOUNT
* lib/fts.c (fts_stat): Use fstatat with AT_NO_AUTOMOUNT
consistently, instead of sometimes using stat (which implies
AT_NO_AUTOMOUNT) and sometimes using fstatat without AT_NO_AUTOMOUNT.
Remove a goto while we’re at it.
Paul Eggert [Tue, 1 Mar 2022 18:01:22 +0000 (10:01 -0800)]
Create lib/Makefile.am after gnulib-comp.m4
* gnulib-tool (func_import): Create library makefile after
creating gnulib-comp.m4. With --gnu-make, the latter depends on
the former. See <https://bugs.gnu.org/32452#109>.
Paul Eggert [Sat, 26 Feb 2022 21:13:09 +0000 (13:13 -0800)]
gettime-res: fix unlikely overflow bug
* lib/gettime-res.c (gettime_res): Fix bug when hz * tv_sec overflows.
With 64-bit ‘long’ and nanosecond resolution the bug can occur
starting in the year 2262, with probability about 2e-9.
With 32-bit ‘long’ the bug can occur now, with same probability.
The probability goes up on hosts with worse timestamp resolution.
Paul Eggert [Sat, 26 Feb 2022 19:39:32 +0000 (11:39 -0800)]
Document clang -fsanitize=undefined glitch
* doc/gnulib-intro.texi (Unsupported Platforms):
Document incompatibility of ‘clang -fsanitize=undefined’
with Gnulib, and how to work around it by also using
‘-fno-sanitize=pointer-overflow’.
* modules/unicase/special-casing: Don't prepend $(AM_V_at) to the
second part of a compound command. It causes make to try and
execute the command "@sed" which doesn't exist.
Paul Eggert [Fri, 25 Feb 2022 23:30:42 +0000 (15:30 -0800)]
Port __has_attribute to Apple’s Clang renumbering
Problem reported by Kirill A. Korinsky in:
https://lists.gnu.org/r/bug-gnulib/2022-02/msg00034.html
* config/srclist.txt: Comment out sys/cdefs.h for now.
* lib/cdefs.h (__glibc_has_attribute):
* m4/gnulib-common.m4 (gl_COMMON_BODY):
Port to Apple’s renumbering of Clang versions.
Paul Eggert [Fri, 25 Feb 2022 19:54:49 +0000 (11:54 -0800)]
nanosleep: simplify by using pselect
GNU Emacs avoids Gnulib’s ‘select’ module and uses only pselect,
which it implements in a special way on MS-DOS.
Unfortunately, though, nanosleep uses ‘select’;
problem reported by Lars Ingebrigtsen (Bug#32452#74).
As far as I can tell, Gnulib nanosleep's use of
‘select’ with signals is only for ancient platforms
that Gnulib no longer cares about, so remove that use of ‘select’.
I don’t know of any platforms that still need this fallback code,
but just in case, fall back to pselect instead, while removing
signal handling that it shouldn’t be needed nowadays.
* lib/nanosleep.c: Do not include sig-handler.h, sys/time.h.
(SIGCONT, suspended, sighandler, my_usleep): Remove.
(nanosleep) [!HAVE_BUG_BIG_NANOSLEEP && !(_WIN32 && !__CYGWIN__)]:
Just call pselect.
* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Do not check for sys/time.h
or call gl_FUNC_SELECT. Do not include sys/time.h or worry
about LIBSOCKET.
(gl_PREREQ_NANOSLEEP): Remove as it’s no longer needed.
All uses removed.
* modules/nanosleep (Depends-on): Add pselect.
Remove select, sigaction, sys_time.
Paul Eggert [Fri, 25 Feb 2022 01:10:12 +0000 (17:10 -0800)]
userspec: warn about '.' separator
Problem reported by Dan Jacobson (Bug#44770).
* lib/userspec.c: Don’t include stdbool.h since it’s now in our API.
(parse_user_spec_warn): New function, broken out of parse_user_spec
and with a new PWARN arg.
(parse_user_spec): Use it.
* lib/userspec.h: Include stdbool.h and declare new function.
* tests/test-userspec.c (struct test.in): Now a char array
so that it can be modified.
(T): Make the placeholder a valid test, as that simplifies
the code. Omit NULL placeholder at the end, likewise.
(main): Set up T in the new way, and test that the "." separator
acts like the ":" separator except with a warning if it works.
Paul Eggert [Tue, 22 Feb 2022 05:59:12 +0000 (21:59 -0800)]
close-stream: don't depend on fclose
This reverts 2022-01-26T17:33:03Z!eggert@cs.ucla.edu.
Depending on fclose broke Emacs, and since this dependency didn't
help GNU m4 let's remove it for now. Problem reported by
Lars Ingebrigtsen <https://bugs.gnu.org/32452#47>.
* modules/close-stream (Depends-on): Remove fclose.
Paul Eggert [Sat, 19 Feb 2022 23:04:43 +0000 (15:04 -0800)]
mktime: improve heuristic for ca-1986 Indiana DST
Problem reported by Mark Krenz <https://bugs.gnu.org/48085>.
* lib/mktime.c (__mktime_internal): Be more generous about
accepting arguments with the wrong value of tm_isdst, by falling
back to a one-hour DST difference if we find no nearby DST that is
unusual. This fixes a problem where "1986-04-28 00:00 EDT" was
rejected when TZ="America/Indianapolis" because the nearest DST
timestamp occurred in 1970, a temporal distance too great for the
old heuristic. This also also narrows the search a bit, which
is a minor performance win.
* m4/mktime.m4 (gl_FUNC_MKTIME_WORKS):
Check for putenv failures and for Bug#48085.
* tests/test-parse-datetime.c (main):
Test for setenv failures and for Bug#48085.
Paul Eggert [Sun, 13 Feb 2022 00:27:05 +0000 (16:27 -0800)]
filevercmp: fix several unexpected results
Problems reported by Michael Debertol in <https://bugs.gnu.org/49239>.
While looking into this, I spotted some more areas where the
code and documentation did not agree, or where the documentation
was unclear. The biggest change needed by coreutils is a new
function filenvercmp that can compare byte strings containing NUL.
* lib/filevercmp.c: Do not include sys/types.h, stdlib.h, string.h.
Include idx.h, verify.h.
(match_suffix): Remove, replacing all uses with calls to ...
(file_prefixlen): ... this new function. Simplify it by
avoiding the need for a confusing READ_ALPHA state variable.
Change its API to something more useful, with a *LEN arg.
it with a new *LEN arg.
(file_prefixlen, verrevcmp):
Prefer idx_t to size_t where either will do.
(order): Change args to S, POS, LEN instead of just S[POS].
This lets us handle NUL bytes correctly. Callers changed.
Verify that ints are sufficiently wide for its API.
(verrevcmp): Don't assume that S1[S1_LEN] is a non-digit,
and likewise for S2[S2_LEN]. The byte might not be accessible
if filenvercmp is being called.
(filevercmp): Reimplement by calling filenvercmp.
(filenvercmp): New function, rewritten without the assumption
that the inputs are null-terminated.
Remove "easy comparison to see if strings are identical", as the
use of it later (a) was undocumented, and (b) caused sort -V to be
unstable. When both strings start with ".", do not skip past
the "."s before looking for suffixes, as this disagreed
with the documentation.
* lib/filevercmp.h: Fix comments, which had many mistakes.
(filenvercmp): New decl.
* modules/filevercmp (Depends-on): Add idx, verify. Remove string.
* tests/test-filevercmp.c: Include string.h.
(examples): Reorder examples ".0" and ".9" that matched the code
but not the documentation. The code has been fixed to match the
documentation. Add some examples involving \1 so that they
can be tried with both \1 and \0. Add some other examples
taken from the bug report.
(equals): New set of test cases.
(sign, test_filevercmp): New functions.
(main): Remove test case where the fixed filevercmp disagrees with
strverscmp. Use test_filevercmp instead of filevercmp, so that
we also test filenvercmp. Test the newly-introduced EQUALS cases.
* lib/string.in.h (strndup): Mark with _GL_ATTRIBUTE_MALLOC and
_GL_ATTRIBUTE_DEALLOC_FREE. For GCC >= 11: Declare also when the
platform already declares the function or when the module 'strndup' is
not in use.
Paul Eggert [Mon, 7 Feb 2022 02:38:32 +0000 (18:38 -0800)]
maint: restore ChangeLog entries dropped in 2004
These entries were dropped by mistake in
2004-10-15T22:57:10Z!simon@josefsson.org
which looks like a merge commit of some sort.
I found the mistake by noticing the misspelling "xstrto".
Paul Eggert [Sat, 5 Feb 2022 19:05:44 +0000 (11:05 -0800)]
parse-datetime: allow calculations to yield -1
Problem reported by Jeremy Cantrell <https://bugs.gnu.org/50115>.
* lib/parse-datetime.y (parse_datetime_body): When calling mktime,
use an unmodifed and negative tm_wday or tm_yday to detect an error,
as a (time_t) -1 return value is valid on most hosts.
* tests/test-parse-datetime.c (main): Add a test for the bug.
Paul Eggert [Fri, 4 Feb 2022 22:27:41 +0000 (14:27 -0800)]
userspec: help fix GNU ‘id’ incompatibility
* lib/userspec.c (parse_with_separator):
Don’t set *username to a numeric string that is not a user name,
and similarly for *groupname. Needed to fix Bug#53631.
Bruno Haible [Sun, 30 Jan 2022 15:44:27 +0000 (16:44 +0100)]
terminfo, terminfo-h: New modules.
* lib/terminfo.h: New file, from GNU gettext.
* m4/terminfo.m4: New file, from GNU gettext.
* modules/terminfo: New file, from GNU gettext.
* modules/terminfo-h: New file, from GNU gettext.
Bruno Haible [Sun, 30 Jan 2022 14:06:22 +0000 (15:06 +0100)]
termcap, termcap-h: New modules.
* lib/termcap.h: New file, from GNU gettext.
* lib/tparm.c: New file, from GNU gettext.
* lib/tputs.c: New file, from GNU gettext.
* m4/termcap.m4: New file, from GNU gettext.
* m4/curses.m4: New file, from GNU gettext.
* modules/termcap: New file, from GNU gettext.
* modules/termcap-h: New file, from GNU gettext.
* top/maint.mk (sc_error_message_uppercase): Don't trigger for
any of the PRI... defines. Note we add an extra constraint
here that PRI always follows a double quote, but that's
almost always the case, or can be easily made so by prepending
"" for example.
Paul Eggert [Thu, 27 Jan 2022 19:36:00 +0000 (11:36 -0800)]
alignalloc: work around AddressSanitizer bug
* doc/posix-functions/aligned_alloc.texi (aligned_alloc):
Mention AddressSanitizer bug.
* lib/alignalloc.h (ALIGNALLOC_VIA_ALIGNED_ALLOC):
Define to 0 if AddressSanitizer is in use.
* tests/test-alignalloc.c (test_alignalloc): New function,
which tests for non-aligned sizes too.
(main): Use it. Don’t bother checking for alignments
greater than 16 MiB, as this flummoxes AddressSanitizer
and there seems little point to testing them.
Paul Eggert [Thu, 27 Jan 2022 19:05:39 +0000 (11:05 -0800)]
doc: use UTF-8 encoding
* doc/gnulib.texi: Use ‘@documentencoding UTF-8’.
Partly this is because there are a few UTF-8 characters
in the .texi files and there seems little point nowadays
to @U-ifiying them. And partly it is so that the .info
output uses nicer UTF-8 characters, e.g., it single-quotes
‘like this’ instead of 'like this'.
Paul Eggert [Thu, 27 Jan 2022 18:57:02 +0000 (10:57 -0800)]
maint: Update copyright notices
* build-aux/announce-gen, build-aux/declared.sh:
* build-aux/git-version-gen, build-aux/gitlog-to-changelog:
* build-aux/gnu-web-doc-update, build-aux/gnupload:
* build-aux/increment-serial, build-aux/libtool-next-version:
* build-aux/useless-if-before-free:
Update some copyright notices by hand, that were not
updated automatically.
Paul Eggert [Mon, 24 Jan 2022 05:07:39 +0000 (21:07 -0800)]
xstrtoimax, xstrtoumax: depend on inttypes-incomplete
This fixes a call to strtoimax without declaring it,
and similarly for strtoumax.
* lib/xstrtoimax.c, lib/xstrtoumax.c (XSTRTOL_INCLUDE_INTTYPES_H):
Define, so that strtoimax and strtoumax are declared.
* lib/xstrtol.c [XSTRTOL_INCLUDE_INTTYPES_H]: Include inttypes.h.
* modules/xstrtoimax, modules/xstrtoumax (Depends-on):
Add inttypes-incomplete.
Paul Eggert [Mon, 17 Jan 2022 22:03:01 +0000 (14:03 -0800)]
extern-inline: improve macOS port
* m4/extern-inline.m4 (gl_EXTERN_INLINE):
Define HAVE___HEADER_INLINE at configure-time, so that config.h
knows the workaround is not needed even though ctype.h has not yet
been included. This lets the compiler use extern inline functions
on newer macOS platforms, instead of static inline.
Problem reported by Reuben Thomas in:
https://lists.gnu.org/r/bug-gnulib/2022-01/msg00130.html
Paul Eggert [Mon, 17 Jan 2022 06:45:47 +0000 (22:45 -0800)]
xstrtol: simplify integer overflow checking
* lib/xstrtol.c: Include intprops.h.
(TYPE_SIGNED): Remove, as intprops.h defines that for us now.
(bkm_scale): Use INT_MULTIPLY_WRAPV instead of checking for
overflow by hand.
Paul Eggert [Mon, 17 Jan 2022 06:31:02 +0000 (22:31 -0800)]
xstrtoll-tests: use %lld for long long
* tests/test-xstrtoll.c, tests/test-xstrtoull.c (__spec):
Do not assume long long is 64 bits, or that exact-width
64-bit types exist. Although these assumptions are true
on current Gnulib platforms they are not true in general.
Also, GCC warns if PRId64 is "ld" but intmax_t is long long
even when long and long long are both 64 bits.
Paul Eggert [Sat, 15 Jan 2022 02:50:48 +0000 (18:50 -0800)]
intprops: work around nvc 22.1 bug
Problem reported by Olivier Cessenat (Bug#53256).
* lib/intprops.h (_GL_HAS_BUILTIN_ADD_OVERFLOW) [__EDG__]:
Define to 0, since __builtin_add_overflow doesn’t work
on NVIDIA HPC SDK 22.1.
Paul Eggert [Sat, 15 Jan 2022 01:27:51 +0000 (17:27 -0800)]
copy-file-range: work around Linux kernel bug
This workaround is adapted from Coreutils.
* lib/copy-file-range.c [__linux__ && HAVE_COPY_FILE_RANGE]:
Include <sys/utsname.h>.
(copy_file_range): Use a stub to replace the copy_file_range of
Linux kernel versions 4.5 through 5.2.
* lib/unistd.in.h (copy_file_range):
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS):
* modules/copy-file-range (configure.ac):
* modules/unistd (unistd.h):
Support replacement of copy_file_range.
* m4/copy-file-range.m4 (gl_FUNC_COPY_FILE_RANGE):
Define HAVE_COPY_FILE_RANGE if the system has copy_file_range,
and on Linux check whether the system’s is known to work.