From 25f8227d25a77d3bc41a2044d2e662e635fa32cd Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 16 Sep 2016 10:05:44 -0600 Subject: [PATCH] mac: fix for 10.12 having clockid_t Previous versions did not have this type, so we defined our own. As of 10.12 it does seem to, so add a configure test for this. Signed-off-by: Jens Axboe --- configure | 20 ++++++++++++++++++++ os/os-mac.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/configure b/configure index 2851f54d..14ec47e9 100755 --- a/configure +++ b/configure @@ -793,6 +793,23 @@ EOF fi echo "CLOCK_MONOTONIC_PRECISE $clock_monotonic_precise" +########################################## +# clockid_t probe +clockid_t="no" +cat > $TMPC << EOF +#include +#include +int main(int argc, char **argv) +{ + clockid_t cid = 0; + return clock_gettime(cid, NULL); +} +EOF +if compile_prog "" "$LIBS" "clockid_t"; then + clockid_t="yes" +fi +echo "clockid_t $clockid_t" + ########################################## # gettimeofday() probe gettimeofday="no" @@ -1722,6 +1739,9 @@ fi if test "$clock_monotonic_precise" = "yes" ; then output_sym "CONFIG_CLOCK_MONOTONIC_PRECISE" fi +if test "$clockid_t" = "yes"; then + output_sym "CONFIG_CLOCKID_T" +fi if test "$gettimeofday" = "yes" ; then output_sym "CONFIG_GETTIMEOFDAY" fi diff --git a/os/os-mac.h b/os/os-mac.h index 76d388e9..0903a6fe 100644 --- a/os/os-mac.h +++ b/os/os-mac.h @@ -35,7 +35,9 @@ typedef off_t off64_t; +#ifndef CONFIG_CLOCKID_T typedef unsigned int clockid_t; +#endif #define FIO_OS_DIRECTIO static inline int fio_set_odirect(int fd) -- 2.25.1