summaryrefslogtreecommitdiff
path: root/os/os-netbsd.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2011-10-04 23:31:00 +0200
committerJens Axboe <axboe@kernel.dk>2011-10-04 23:32:29 +0200
commit901ebe18bdca90032e2fe107a1410385da80d18b (patch)
treee443af93a81f3d11fd16e6a5e13fe21ea87b67b3 /os/os-netbsd.h
parent5037b845e0936730b5540955be64d9279ac8af9d (diff)
downloadfio-901ebe18bdca90032e2fe107a1410385da80d18b.tar.gz
fio-901ebe18bdca90032e2fe107a1410385da80d18b.tar.bz2
Finalize (?) byte swap/endian stuff
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'os/os-netbsd.h')
-rw-r--r--os/os-netbsd.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/os/os-netbsd.h b/os/os-netbsd.h
index e03866df..5d8258bd 100644
--- a/os/os-netbsd.h
+++ b/os/os-netbsd.h
@@ -4,6 +4,7 @@
#include <errno.h>
#include <sys/param.h>
#include <sys/thr.h>
+#include <sys/endian.h>
/* XXX hack to avoid confilcts between rbtree.h and <sys/rb.h> */
#define rb_node _rb_node
#include <sys/sysctl.h>
@@ -30,6 +31,16 @@
#define PTHREAD_STACK_MIN 4096
#endif
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define FIO_LITTLE_ENDIAN
+#else
+#define FIO_BIG_ENDIAN
+#endif
+
+#define fio_swap16(x) bswap16(x)
+#define fio_swap32(x) bswap32(x)
+#define fio_swap64(x) bswap64(x)
+
typedef off_t off64_t;
static inline int blockdev_invalidate_cache(struct fio_file *f)