X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=os-freebsd.h;h=01c5ce917b57d9501774cd80d8a84e82b6df6b35;hp=31fa01071aaf283410a4059bcd40cdb670cd8268;hb=5b38ee84f35c7cf3a3a804e6dbe3621f8980d3bb;hpb=32cd46a085ac60f4f8b085e2d65ebfc6100bb8c5 diff --git a/os-freebsd.h b/os-freebsd.h index 31fa0107..01c5ce91 100644 --- a/os-freebsd.h +++ b/os-freebsd.h @@ -1,23 +1,32 @@ #ifndef FIO_OS_FREEBSD_H #define FIO_OS_FREEBSD_H +#include + #undef FIO_HAVE_LIBAIO #define FIO_HAVE_POSIXAIO #undef FIO_HAVE_FADVISE #undef FIO_HAVE_CPU_AFFINITY #undef FIO_HAVE_DISK_UTIL #undef FIO_HAVE_SGIO +#define FIO_HAVE_ODIRECT #define OS_MAP_ANON (MAP_ANON) typedef unsigned long os_cpu_mask_t; +typedef unsigned int os_random_state_t; /* * FIXME */ static inline int blockdev_size(int fd, unsigned long long *bytes) { - return 1; + return EINVAL; +} + +static inline int blockdev_invalidate_cache(int fd) +{ + return EINVAL; } static inline unsigned long long os_phys_mem(void) @@ -30,4 +39,24 @@ static inline unsigned long long os_phys_mem(void) return mem; } +static inline void os_random_seed(unsigned long seed, os_random_state_t *rs) +{ + srand(seed); +} + +static inline long os_random_long(os_random_state_t *rs) +{ + long val; + + val = rand_r(rs); + return val; +} + +static inline double os_random_double(os_random_state_t *rs) +{ + double val; + + val = (double) rand_r(rs); + return val; +} #endif