]> Savannah Git Hosting - gnulib.git/commit
lseek: avoid SEEK_HOLE bugs in FreeBSD, macOS
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 19 Feb 2023 06:05:24 +0000 (00:05 -0600)
committerBruno Haible <bruno@clisp.org>
Thu, 2 Mar 2023 20:00:44 +0000 (21:00 +0100)
commitdbf38a0e447a4ba40b2b3496e0c9e9782e086e1c
treeab67f18907b6478efb08900e79e7d55fbc739bfb
parentd4939bb183a52895b75cfadc2c17218e6fc06290
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.
ChangeLog
doc/posix-functions/lseek.texi
lib/unistd.in.h
m4/lseek.m4