fio netbsd support
[fio.git] / os / os-freebsd.h
index ba2541a5f5f25159f6fa0c4ed4a25c4336daa09d..d1313e8ccb868ccdf8bdc11974cd8b384bb684f8 100644 (file)
@@ -1,28 +1,15 @@
 #ifndef FIO_OS_FREEBSD_H
 #define FIO_OS_FREEBSD_H
 
+#include <errno.h>
 #include <sys/sysctl.h>
 
-#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 FIO_USE_GENERIC_BDEV_SIZE
+#define FIO_USE_GENERIC_RAND
 
-#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 EINVAL;
-}
+#define OS_MAP_ANON            MAP_ANON
 
 static inline int blockdev_invalidate_cache(int fd)
 {
@@ -39,17 +26,8 @@ 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;
-}
+#ifdef MADV_FREE
+#define FIO_MADV_FREE  MADV_FREE
+#endif
 
 #endif