X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=os%2Fos-solaris.h;h=866e0c0e17b7dd5eefa741da991ca619dae69303;hp=898da18e988d205004f8826c8ba08d6768ac2352;hb=e116f2b90f110334e77741227ad4e4600302c718;hpb=317b95d07d4921d2594a1be6e014c9c2d062fe75 diff --git a/os/os-solaris.h b/os/os-solaris.h index 898da18e..866e0c0e 100644 --- a/os/os-solaris.h +++ b/os/os-solaris.h @@ -1,13 +1,13 @@ #ifndef FIO_OS_SOLARIS_H #define FIO_OS_SOLARIS_H -#undef FIO_HAVE_LIBAIO +#include +#include + #define FIO_HAVE_POSIXAIO -#undef FIO_HAVE_FADVISE -#undef FIO_HAVE_CPU_AFFINITY -#undef FIO_HAVE_DISK_UTIL -#undef FIO_HAVE_SGIO -#undef FIO_HAVE_ODIRECT +#define FIO_HAVE_SOLARISAIO +#define FIO_HAVE_FALLOCATE +#define FIO_HAVE_POSIXAIO_FSYNC #define OS_MAP_ANON (MAP_ANON) @@ -54,12 +54,14 @@ static inline long os_random_long(os_random_state_t *rs) return val; } -static inline double os_random_double(os_random_state_t *rs) +#define FIO_OS_DIRECTIO +extern int directio(int, int); +static inline int fio_set_odirect(int fd) { - double val; + if (directio(fd, DIRECTIO_ON) < 0) + return errno; - val = (double) rand_r(rs); - return val; + return 0; } #endif