summaryrefslogtreecommitdiff
path: root/os/os-solaris.h
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-06-04 15:14:24 +0200
committerJens Axboe <jens.axboe@oracle.com>2008-06-04 15:14:24 +0200
commite116f2b90f110334e77741227ad4e4600302c718 (patch)
treea59fbf956183b934d14f996912835f62a9be8b62 /os/os-solaris.h
parentd5707a3565e958af566247e2c0acf09e031d8921 (diff)
downloadfio-e116f2b90f110334e77741227ad4e4600302c718.tar.gz
fio-e116f2b90f110334e77741227ad4e4600302c718.tar.bz2
Add directio support to Solaris
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'os/os-solaris.h')
-rw-r--r--os/os-solaris.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/os/os-solaris.h b/os/os-solaris.h
index ac22bff1..866e0c0e 100644
--- a/os/os-solaris.h
+++ b/os/os-solaris.h
@@ -1,6 +1,9 @@
#ifndef FIO_OS_SOLARIS_H
#define FIO_OS_SOLARIS_H
+#include <sys/types.h>
+#include <sys/fcntl.h>
+
#define FIO_HAVE_POSIXAIO
#define FIO_HAVE_SOLARISAIO
#define FIO_HAVE_FALLOCATE
@@ -51,4 +54,14 @@ static inline long os_random_long(os_random_state_t *rs)
return val;
}
+#define FIO_OS_DIRECTIO
+extern int directio(int, int);
+static inline int fio_set_odirect(int fd)
+{
+ if (directio(fd, DIRECTIO_ON) < 0)
+ return errno;
+
+ return 0;
+}
+
#endif