From 6e59fb92aafa4803ceed411e1610a4f458ed092b Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.munro@gmail.com>
Date: Fri, 26 Aug 2022 15:00:26 +1200
Subject: [PATCH 2/3] Remove configure probe for F_FULLSYNC.

This was done to avoid using it on very old macOS systems.
---
 configure                  | 14 --------------
 configure.ac               |  3 ---
 src/include/pg_config.h.in |  4 ----
 src/include/port/darwin.h  |  3 ---
 src/tools/msvc/Solution.pm |  1 -
 5 files changed, 25 deletions(-)

diff --git a/configure b/configure
index a268780c5d..6975c3f0ca 100755
--- a/configure
+++ b/configure
@@ -16204,20 +16204,6 @@ esac
 fi
 
 
-# This is probably only present on macOS, but may as well check always
-ac_fn_c_check_decl "$LINENO" "F_FULLFSYNC" "ac_cv_have_decl_F_FULLFSYNC" "#include <fcntl.h>
-"
-if test "x$ac_cv_have_decl_F_FULLFSYNC" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_F_FULLFSYNC $ac_have_decl
-_ACEOF
-
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PS_STRINGS" >&5
 $as_echo_n "checking for PS_STRINGS... " >&6; }
 if ${pgac_cv_var_PS_STRINGS+:} false; then :
diff --git a/configure.ac b/configure.ac
index 993b5d5cb0..e293bfdfb7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1798,9 +1798,6 @@ AC_CHECK_DECLS([strlcat, strlcpy, strnlen])
 AC_CHECK_DECLS([preadv], [], [AC_LIBOBJ(preadv)], [#include <sys/uio.h>])
 AC_CHECK_DECLS([pwritev], [], [AC_LIBOBJ(pwritev)], [#include <sys/uio.h>])
 
-# This is probably only present on macOS, but may as well check always
-AC_CHECK_DECLS(F_FULLFSYNC, [], [], [#include <fcntl.h>])
-
 AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS],
 [AC_LINK_IFELSE([AC_LANG_PROGRAM(
 [#include <machine/vmparam.h>
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index c5a80b829e..6d1e2c2904 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -95,10 +95,6 @@
    don't. */
 #undef HAVE_DECL_FDATASYNC
 
-/* Define to 1 if you have the declaration of `F_FULLFSYNC', and to 0 if you
-   don't. */
-#undef HAVE_DECL_F_FULLFSYNC
-
 /* Define to 1 if you have the declaration of
    `LLVMCreateGDBRegistrationListener', and to 0 if you don't. */
 #undef HAVE_DECL_LLVMCREATEGDBREGISTRATIONLISTENER
diff --git a/src/include/port/darwin.h b/src/include/port/darwin.h
index 15fb69d6db..36c54b2152 100644
--- a/src/include/port/darwin.h
+++ b/src/include/port/darwin.h
@@ -2,7 +2,4 @@
 
 #define __darwin__	1
 
-#if HAVE_DECL_F_FULLFSYNC		/* not present before macOS 10.3 */
 #define HAVE_FSYNC_WRITETHROUGH
-
-#endif
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index c2acb58df0..86dfa9faa6 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -233,7 +233,6 @@ sub GenerateFiles
 		HAVE_CRTDEFS_H             => undef,
 		HAVE_CRYPTO_LOCK           => undef,
 		HAVE_DECL_FDATASYNC        => 0,
-		HAVE_DECL_F_FULLFSYNC      => 0,
 		HAVE_DECL_LLVMCREATEGDBREGISTRATIONLISTENER => 0,
 		HAVE_DECL_LLVMCREATEPERFJITEVENTLISTENER    => 0,
 		HAVE_DECL_LLVMGETHOSTCPUNAME                => 0,
-- 
2.35.1

