mirror of
https://github.com/postgres/postgres.git
synced 2025-10-21 02:52:47 +03:00
Remove configure probe for fdatasync.
fdatasync() is in SUSv2, and all targeted Unix systems have it. We have a replacement function for Windows. We retain the probe for the function declaration, which allows us to supply the mysteriously missing declaration for macOS, and also for Windows. No need to keep a HAVE_FDATASYNC macro around. Also rename src/port/fdatasync.c to win32fdatasync.c since it's only for Windows. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CA+hUKGJ3LHeP9w5Fgzdr4G8AnEtJ=z=p6hGDEm4qYGEUX5B6fQ@mail.gmail.com Discussion: https://postgr.es/m/CA%2BhUKGJZJVO%3DiX%2Beb-PXi2_XS9ZRqnn_4URh0NUQOwt6-_51xQ%40mail.gmail.com
This commit is contained in:
@@ -67,8 +67,7 @@ typedef uint16 RepOriginId;
|
||||
/*
|
||||
* This chunk of hackery attempts to determine which file sync methods
|
||||
* are available on the current platform, and to choose an appropriate
|
||||
* default method. We assume that fsync() is always available, and that
|
||||
* configure determined whether fdatasync() is.
|
||||
* default method.
|
||||
*
|
||||
* Note that we define our own O_DSYNC on Windows, but not O_SYNC.
|
||||
*/
|
||||
@@ -76,10 +75,8 @@ typedef uint16 RepOriginId;
|
||||
#define DEFAULT_SYNC_METHOD PLATFORM_DEFAULT_SYNC_METHOD
|
||||
#elif defined(O_DSYNC) && (!defined(O_SYNC) || O_DSYNC != O_SYNC)
|
||||
#define DEFAULT_SYNC_METHOD SYNC_METHOD_OPEN_DSYNC
|
||||
#elif defined(HAVE_FDATASYNC)
|
||||
#define DEFAULT_SYNC_METHOD SYNC_METHOD_FDATASYNC
|
||||
#else
|
||||
#define DEFAULT_SYNC_METHOD SYNC_METHOD_FSYNC
|
||||
#define DEFAULT_SYNC_METHOD SYNC_METHOD_FDATASYNC
|
||||
#endif
|
||||
|
||||
#endif /* XLOG_DEFS_H */
|
||||
|
Reference in New Issue
Block a user