client: improve poll() loop
[fio.git] / os / os-freebsd.h
index 0cb7ae5e5ca079380e20a514f1f0f1b9df3748c2..317d403f3bd3f228deeaf7d45f00312986c65be3 100644 (file)
@@ -4,14 +4,17 @@
 #include <errno.h>
 #include <sys/sysctl.h>
 #include <sys/disk.h>
+#include <sys/thr.h>
+
+#include "../file.h"
 
 #define FIO_HAVE_POSIXAIO
 #define FIO_HAVE_ODIRECT
-#define FIO_HAVE_IOPRIO
 #define FIO_HAVE_STRSEP
 #define FIO_USE_GENERIC_RAND
 #define FIO_HAVE_CHARDEV_SIZE
 #define FIO_HAVE_CLOCK_MONOTONIC
+#define FIO_HAVE_GETTID
 
 #define OS_MAP_ANON            MAP_ANON
 
@@ -32,7 +35,7 @@ static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
 
 static inline int chardev_size(struct fio_file *f, unsigned long long *bytes)
 {
-       return blockdev_size(f->fd, bytes);
+       return blockdev_size(f, bytes);
 }
 
 static inline int blockdev_invalidate_cache(struct fio_file *f)
@@ -50,6 +53,14 @@ static inline unsigned long long os_phys_mem(void)
        return mem;
 }
 
+static inline int gettid(void)
+{
+       long lwpid;
+
+       thr_self(&lwpid);
+       return (int) lwpid;
+}
+
 #ifdef MADV_FREE
 #define FIO_MADV_FREE  MADV_FREE
 #endif