summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2023-02-19 00:05:24 -0600
committerPaul Eggert <eggert@cs.ucla.edu>2023-02-23 11:16:05 -0800
commit7352d9fec59398c76c3bb8a2ef86ba58818f0342 (patch)
tree34abc08d812cce346359130d0b81e90712ac50ea /doc
parentbb3fd10e6309f017618a12b2c10d3bfb813bfc08 (diff)
downloadgnulib-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')
-rw-r--r--doc/posix-functions/lseek.texi5
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