stream: Fix MacOS build. fsync as alias for fdatasync. (#6882)

If fdatasync is not available, use fsync instead.

For some reason, fdatasync is available when using clang from Xcode, even though no declaration is present in headers.
This commit is contained in:
David CARLIER 2021-04-21 15:21:43 +01:00 committed by GitHub
parent 533a6bcb29
commit 7aba6de1d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -548,6 +548,7 @@ asctime_r \
chroot \ chroot \
ctime_r \ ctime_r \
explicit_memset \ explicit_memset \
fdatasync \
flock \ flock \
ftok \ ftok \
funopen \ funopen \

View File

@ -58,6 +58,9 @@ extern int php_get_gid_by_name(const char *name, gid_t *gid);
#define fdatasync fsync #define fdatasync fsync
#else #else
# define PLAIN_WRAP_BUF_SIZE(st) (st) # define PLAIN_WRAP_BUF_SIZE(st) (st)
# if !defined(HAVE_FDATASYNC)
# define fdatasync fsync
# endif
#endif #endif
/* parse standard "fopen" modes into open() flags */ /* parse standard "fopen" modes into open() flags */