configure: stop enabling fdatasync on OSX
authorSitsofe Wheeler <sitsofe@yahoo.com>
Sat, 5 Oct 2019 11:04:33 +0000 (12:04 +0100)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Sun, 6 Oct 2019 06:33:36 +0000 (07:33 +0100)
Change configure compile probes to fail on implicit declarations. This
(correctly) stops us from enabling fdatasync on OSX which was
problematic because we were actually calling a syscall stub with
arguments different to what was declared in its prototype (see
https://github.com/gbrault/picoc/issues/145#issuecomment-89734655 and
https://gitlab.freedesktop.org/xdg/shared-mime-info/issues/7 ).

Fixes: https://github.com/axboe/fio/issues/834 ("Drop macOS support for
fdatasync")

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
HOWTO
configure
fio.1
os/os-mac.h

diff --git a/HOWTO b/HOWTO
index 4fef1504a410a205c95c7c85b489f0068bceb1a5..96a047de7b1e26f698b92e2e8309a15769bc6712 100644 (file)
--- a/HOWTO
+++ b/HOWTO
@@ -1279,7 +1279,7 @@ I/O type
 .. option:: fdatasync=int
 
        Like :option:`fsync` but uses :manpage:`fdatasync(2)` to only sync data and
-       not metadata blocks.  In Windows, FreeBSD, and DragonFlyBSD there is no
+       not metadata blocks. In Windows, FreeBSD, DragonFlyBSD or OSX there is no
        :manpage:`fdatasync(2)` so this falls back to using :manpage:`fsync(2)`.
        Defaults to 0, which means fio does not periodically issue and wait for a
        data-only sync to complete.
index 59da2f7ecc1123215261a268b3c65697c7cd8b78..e32d5dcf8735d16c129f529ddacb0965cee71f62 100755 (executable)
--- a/configure
+++ b/configure
@@ -88,14 +88,14 @@ do_cc() {
 }
 
 compile_object() {
-  do_cc $CFLAGS -c -o $TMPO $TMPC
+  do_cc $CFLAGS -Werror-implicit-function-declaration -c -o $TMPO $TMPC
 }
 
 compile_prog() {
   local_cflags="$1"
   local_ldflags="$2 $LIBS"
   echo "Compiling test case $3" >> config.log
-  do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
+  do_cc $CFLAGS -Werror-implicit-function-declaration $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
 }
 
 feature_not_found() {
diff --git a/fio.1 b/fio.1
index 77a2d79982458251c5bbb5f048b7232ddc06ac7c..6685e50790b320d5c404c3954b9840213931e30e 100644 (file)
--- a/fio.1
+++ b/fio.1
@@ -1050,7 +1050,7 @@ see \fBend_fsync\fR and \fBfsync_on_close\fR.
 .TP
 .BI fdatasync \fR=\fPint
 Like \fBfsync\fR but uses \fBfdatasync\fR\|(2) to only sync data and
-not metadata blocks. In Windows, FreeBSD, and DragonFlyBSD there is no
+not metadata blocks. In Windows, FreeBSD, DragonFlyBSD or OSX there is no
 \fBfdatasync\fR\|(2) so this falls back to using \fBfsync\fR\|(2).
 Defaults to 0, which means fio does not periodically issue and wait for a
 data\-only sync to complete.
index a073300c40c5ed6fea8c2ec2ff4933776ef7066d..0d97f6b984c60196cbc66a11737a612bc815e1e9 100644 (file)
@@ -97,12 +97,6 @@ static inline int gettid(void)
 }
 #endif
 
-/*
- * For some reason, there's no header definition for fdatasync(), even
- * if it exists.
- */
-extern int fdatasync(int fd);
-
 static inline bool fio_fallocate(struct fio_file *f, uint64_t offset, uint64_t len)
 {
        fstore_t store = {F_ALLOCATEALL, F_PEOFPOSMODE, offset, len};