blob: 8f61ec549aa83cc65e037ef3e4299f1f61c547e8 [file] [log] [blame]
Jens Axboec50bdd82010-05-21 07:14:04 +02001#ifndef FIO_OS_NETBSD_H
2#define FIO_OS_NETBSD_H
3
4#include <errno.h>
5#include <sys/param.h>
6/* XXX hack to avoid confilcts between rbtree.h and <sys/rb.h> */
7#define rb_node _rb_node
8#include <sys/sysctl.h>
9#undef rb_node
10#undef rb_left
11#undef rb_right
12
Jens Axboee2e58882011-01-04 08:36:06 +010013#include "../file.h"
14
Jens Axboec50bdd82010-05-21 07:14:04 +020015#define FIO_HAVE_POSIXAIO
16#define FIO_HAVE_FADVISE
Jens Axboec50bdd82010-05-21 07:14:04 +020017#define FIO_HAVE_ODIRECT
18#define FIO_HAVE_STRSEP
19#define FIO_HAVE_FDATASYNC
20#define FIO_USE_GENERIC_BDEV_SIZE
21#define FIO_USE_GENERIC_RAND
22
23#undef FIO_HAVE_CPU_AFFINITY /* XXX notyet */
24
25#define OS_MAP_ANON MAP_ANON
26
Bruce Cran9b836562011-01-08 19:49:54 +010027#ifndef PTHREAD_STACK_MIN
28#define PTHREAD_STACK_MIN 4096
29#endif
30
Jens Axboec50bdd82010-05-21 07:14:04 +020031typedef off_t off64_t;
32
Bruce Cran9b836562011-01-08 19:49:54 +010033static inline int blockdev_invalidate_cache(struct fio_file *f)
Jens Axboec50bdd82010-05-21 07:14:04 +020034{
35 return EINVAL;
36}
37
38static inline unsigned long long os_phys_mem(void)
39{
40 int mib[2] = { CTL_HW, HW_PHYSMEM64 };
41 uint64_t mem;
42 size_t len = sizeof(mem);
43
44 sysctl(mib, 2, &mem, &len, NULL, 0);
45 return mem;
46}
47
48#ifdef MADV_FREE
49#define FIO_MADV_FREE MADV_FREE
50#endif
51
52/* XXX NetBSD doesn't have getopt_long_only */
53#define getopt_long_only getopt_long
54
55#endif