+#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;
+ if (ioctl(f->fd, DKIOCGETBLOCKCOUNT, bytes) == -1)
+ return errno;
+ if (ioctl(f->fd, DKIOCGETBLOCKSIZE, &temp) == -1)
+ return errno;
+ (*bytes) *= temp;
+ return 0;
+}
+