Commit | Line | Data |
---|---|---|
c50bdd8f JA |
1 | #ifndef FIO_OS_NETBSD_H |
2 | #define FIO_OS_NETBSD_H | |
3 | ||
4 | #include <errno.h> | |
5 | #include <sys/param.h> | |
b939683e | 6 | #include <sys/thr.h> |
c50bdd8f JA |
7 | /* XXX hack to avoid confilcts between rbtree.h and <sys/rb.h> */ |
8 | #define rb_node _rb_node | |
9 | #include <sys/sysctl.h> | |
10 | #undef rb_node | |
11 | #undef rb_left | |
12 | #undef rb_right | |
13 | ||
e2e58886 JA |
14 | #include "../file.h" |
15 | ||
c50bdd8f JA |
16 | #define FIO_HAVE_POSIXAIO |
17 | #define FIO_HAVE_FADVISE | |
c50bdd8f JA |
18 | #define FIO_HAVE_ODIRECT |
19 | #define FIO_HAVE_STRSEP | |
20 | #define FIO_HAVE_FDATASYNC | |
21 | #define FIO_USE_GENERIC_BDEV_SIZE | |
22 | #define FIO_USE_GENERIC_RAND | |
b9afd959 | 23 | #define FIO_HAVE_GETTID |
c50bdd8f JA |
24 | |
25 | #undef FIO_HAVE_CPU_AFFINITY /* XXX notyet */ | |
26 | ||
27 | #define OS_MAP_ANON MAP_ANON | |
28 | ||
9b836561 BC |
29 | #ifndef PTHREAD_STACK_MIN |
30 | #define PTHREAD_STACK_MIN 4096 | |
31 | #endif | |
32 | ||
c50bdd8f JA |
33 | typedef off_t off64_t; |
34 | ||
9b836561 | 35 | static inline int blockdev_invalidate_cache(struct fio_file *f) |
c50bdd8f JA |
36 | { |
37 | return EINVAL; | |
38 | } | |
39 | ||
40 | static inline unsigned long long os_phys_mem(void) | |
41 | { | |
42 | int mib[2] = { CTL_HW, HW_PHYSMEM64 }; | |
43 | uint64_t mem; | |
44 | size_t len = sizeof(mem); | |
45 | ||
46 | sysctl(mib, 2, &mem, &len, NULL, 0); | |
47 | return mem; | |
48 | } | |
49 | ||
b9afd959 JA |
50 | static inline int gettid(void) |
51 | { | |
52 | long lwpid; | |
53 | ||
54 | thr_self(&lwpid); | |
55 | return (int) lwpid; | |
56 | } | |
57 | ||
c50bdd8f JA |
58 | #ifdef MADV_FREE |
59 | #define FIO_MADV_FREE MADV_FREE | |
60 | #endif | |
61 | ||
62 | /* XXX NetBSD doesn't have getopt_long_only */ | |
63 | #define getopt_long_only getopt_long | |
64 | ||
65 | #endif |