]> 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 21:05:46 +0000 (22:05 +0100)
commit75976a9faf3a01e62ce2bdafb72a925fa05d842b
tree0b15e10ae9d3cd467abe78f9b0a46162360a5cd0
parent2411648c46c9375c844522a1708fa730203d6b03
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