1 #ifndef FIO_OS_NETBSD_H
2 #define FIO_OS_NETBSD_H
4 #define FIO_OS os_netbsd
9 #include <sys/endian.h>
10 /* XXX hack to avoid confilcts between rbtree.h and <sys/rb.h> */
11 #define rb_node _rb_node
12 #include <sys/sysctl.h>
19 #define FIO_HAVE_POSIXAIO
20 #define FIO_HAVE_FADVISE
21 #define FIO_HAVE_ODIRECT
22 #define FIO_HAVE_STRSEP
23 #define FIO_HAVE_FDATASYNC
24 #define FIO_USE_GENERIC_BDEV_SIZE
25 #define FIO_USE_GENERIC_RAND
26 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
27 #define FIO_HAVE_GETTID
29 #undef FIO_HAVE_CPU_AFFINITY /* XXX notyet */
31 #define OS_MAP_ANON MAP_ANON
33 #ifndef PTHREAD_STACK_MIN
34 #define PTHREAD_STACK_MIN 4096
37 #if BYTE_ORDER == LITTLE_ENDIAN
38 #define FIO_LITTLE_ENDIAN
40 #define FIO_BIG_ENDIAN
43 #define fio_swap16(x) bswap16(x)
44 #define fio_swap32(x) bswap32(x)
45 #define fio_swap64(x) bswap64(x)
47 typedef off_t off64_t;
49 static inline int blockdev_invalidate_cache(struct fio_file *f)
54 static inline unsigned long long os_phys_mem(void)
56 int mib[2] = { CTL_HW, HW_PHYSMEM64 };
58 size_t len = sizeof(mem);
60 sysctl(mib, 2, &mem, &len, NULL, 0);
64 static inline int gettid(void)
73 #define FIO_MADV_FREE MADV_FREE
76 /* XXX NetBSD doesn't have getopt_long_only */
77 #define getopt_long_only getopt_long