summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2023-02-26 14:11:18 +0800
committerPo Lu <luangruo@yahoo.com>2023-02-26 14:11:18 +0800
commit28f6add67f8c30999a3809b242fa66f558a27005 (patch)
treefaa2f013f9d52a2b7991a14fe90ee5c1c28bf8da /lib
parent39ddf1855bbebc5d31b544e6308a4ae49f4925b3 (diff)
parent580bb8f46c413506e53f77a25fbdea3322922f88 (diff)
downloademacs-28f6add67f8c30999a3809b242fa66f558a27005.tar.gz
Merge remote-tracking branch 'origin/master' into feature/android
Diffstat (limited to 'lib')
-rw-r--r--lib/unistd.in.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index bfc501e5a7d..8ba9867894e 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -40,6 +40,24 @@
# undef _GL_INCLUDING_UNISTD_H
#endif
+/* Avoid lseek bugs in FreeBSD, macOS <https://bugs.gnu.org/61386>.
+ This bug is fixed after FreeBSD 13; see <https://bugs.freebsd.org/256205>.
+ Use macOS "9999" to stand for a future fixed macOS version. */
+#if defined __FreeBSD__ && __FreeBSD__ < 14
+# undef SEEK_DATA
+# undef SEEK_HOLE
+#elif defined __APPLE__ && defined __MACH__ && defined SEEK_DATA
+# ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
+# include <AvailabilityMacros.h>
+# endif
+# if (!defined MAC_OS_X_VERSION_MIN_REQUIRED \
+ || MAC_OS_X_VERSION_MIN_REQUIRED < 99990000)
+# include <sys/fcntl.h> /* It also defines the two macros. */
+# undef SEEK_DATA
+# undef SEEK_HOLE
+# endif
+#endif
+
/* Get all possible declarations of gethostname(). */
#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@ \
&& !defined _GL_INCLUDING_WINSOCK2_H