From: Steven Noonan Date: Sat, 23 Apr 2011 06:08:13 +0000 (-0700) Subject: os-mac.h: implement fio_set_odirect() X-Git-Tag: fio-1.52~4 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=7e8ad197a8d219e2fc181c881143f11891e7d0d5;p=fio.git os-mac.h: implement fio_set_odirect() Signed-off-by: Steven Noonan Signed-off-by: Jens Axboe --- diff --git a/os/os-mac.h b/os/os-mac.h index 1d671414..42e1fea9 100644 --- a/os/os-mac.h +++ b/os/os-mac.h @@ -2,6 +2,7 @@ #define FIO_OS_APPLE_H #include +#include #include #include #include @@ -107,6 +108,14 @@ static inline int timer_delete(timer_t timer) return 0; } +#define FIO_OS_DIRECTIO +static inline int fio_set_odirect(int fd) +{ + if (fcntl(fd, F_NOCACHE, 1) == -1) + return errno; + return 0; +} + static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) { uint64_t temp = 1;