diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2023-02-19 00:05:24 -0600 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2023-02-23 11:16:05 -0800 |
commit | 7352d9fec59398c76c3bb8a2ef86ba58818f0342 (patch) | |
tree | 34abc08d812cce346359130d0b81e90712ac50ea /doc/posix-functions | |
parent | bb3fd10e6309f017618a12b2c10d3bfb813bfc08 (diff) | |
download | gnulib-7352d9fec59398c76c3bb8a2ef86ba58818f0342.tar.gz |
lseek: avoid SEEK_HOLE bugs in FreeBSD, macOS
This attempts to fix <https://bugs.gnu.org/61386>, a bug in GNU cp
caused by a serious data corruption bug in FreeBSD and macOS.
* doc/posix-functions/lseek.texi: Mention the bug.
* lib/unistd.in.h (SEEK_DATA, SEEK_HOLE): Undef in macOS < 13 and
FreeBSD < 14. FreeBSD fixed the bug sometime during FreeBSD 13
<https://bugs.freebsd.org/256205>, so the "FreeBSD < 14" is
conservative. It’s unknown when Apple will fix macOS so use
macOS "9999" as a placeholder.
* m4/lseek.m4 (gl_FUNC_LSEEK): Replace lseek if on one of the
above platforms.
Diffstat (limited to 'doc/posix-functions')
-rw-r--r-- | doc/posix-functions/lseek.texi | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/posix-functions/lseek.texi b/doc/posix-functions/lseek.texi index 2f8e2b5877..3470524b12 100644 --- a/doc/posix-functions/lseek.texi +++ b/doc/posix-functions/lseek.texi @@ -37,4 +37,9 @@ IRIX 6.5. @item Some systems do not support @code{SEEK_DATA} and @code{SEEK_HOLE}: AIX, HP-UX, Microsoft Windows, NetBSD, OpenBSD. +@item +Some systems have a buggy @code{SEEK_DATA} and @code{SEEK_HOLE}, +and Gnulib works around the problem via @code{#undef SEEK_DATA} +and @code{#undef SEEK_HOLE}: +FreeBSD 13, macOS 12. @end itemize |