Commit | Line | Data |
---|---|---|
ebac4655 JA |
1 | #ifndef FIO_OS_H |
2 | #define FIO_OS_H | |
3 | ||
4 | #if defined(__linux__) | |
5 | #include "os-linux.h" | |
6 | #elif defined(__FreeBSD__) | |
7 | #include "os-freebsd.h" | |
2c0ecd28 JA |
8 | #elif defined(__sun__) |
9 | #include "os-solaris.h" | |
ebac4655 JA |
10 | #else |
11 | #error "unsupported os" | |
12 | #endif | |
13 | ||
14 | #ifdef FIO_HAVE_LIBAIO | |
15 | #include <libaio.h> | |
16 | #endif | |
17 | ||
18 | #ifdef FIO_HAVE_POSIXAIO | |
19 | #include <aio.h> | |
20 | #endif | |
21 | ||
22 | #ifdef FIO_HAVE_SGIO | |
23 | #include <linux/fs.h> | |
24 | #include <scsi/sg.h> | |
25 | #endif | |
26 | ||
27 | #ifndef FIO_HAVE_FADVISE | |
28 | #define fadvise(fd, off, len, advice) (0) | |
29 | ||
30 | #define POSIX_FADV_DONTNEED (0) | |
31 | #define POSIX_FADV_SEQUENTIAL (0) | |
32 | #define POSIX_FADV_RANDOM (0) | |
33 | #endif /* FIO_HAVE_FADVISE */ | |
34 | ||
35 | #ifndef FIO_HAVE_CPU_AFFINITY | |
36 | #define fio_setaffinity(td) (0) | |
37 | #define fio_getaffinity(pid, mask) (0) | |
38 | #endif | |
39 | ||
40 | #ifndef FIO_HAVE_IOPRIO | |
41 | #define ioprio_set(which, who, prio) (0) | |
42 | #endif | |
43 | ||
2c0ecd28 | 44 | #ifndef FIO_HAVE_ODIRECT |
7d424763 JA |
45 | #define OS_O_DIRECT 0 |
46 | #else | |
47 | #define OS_O_DIRECT O_DIRECT | |
2c0ecd28 JA |
48 | #endif |
49 | ||
74b025b0 JA |
50 | #ifndef FIO_HAVE_HUGETLB |
51 | #define SHM_HUGETLB 0 | |
52 | #define FIO_HUGE_PAGE 0 | |
53 | #else | |
cb25df61 | 54 | #ifndef FIO_HUGE_PAGE |
ee0e0a71 | 55 | #define FIO_HUGE_PAGE 4194304 |
74b025b0 | 56 | #endif |
cb25df61 | 57 | #endif |
74b025b0 | 58 | |
b2fdda43 JA |
59 | #if __GNUC__ < 3 |
60 | #define __must_check | |
61 | #else | |
62 | #define __must_check __attribute__((warn_unused_result)) | |
63 | #endif | |
64 | ||
ebac4655 | 65 | #endif |