Fio 1.17.1
[fio.git] / os / os.h
CommitLineData
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
4d8947de 30#ifndef POSIX_FADV_DONTNEED
ebac4655
JA
31#define POSIX_FADV_DONTNEED (0)
32#define POSIX_FADV_SEQUENTIAL (0)
33#define POSIX_FADV_RANDOM (0)
4d8947de 34#endif
ebac4655
JA
35#endif /* FIO_HAVE_FADVISE */
36
37#ifndef FIO_HAVE_CPU_AFFINITY
38#define fio_setaffinity(td) (0)
39#define fio_getaffinity(pid, mask) (0)
40#endif
41
42#ifndef FIO_HAVE_IOPRIO
43#define ioprio_set(which, who, prio) (0)
44#endif
45
2c0ecd28 46#ifndef FIO_HAVE_ODIRECT
7d424763
JA
47#define OS_O_DIRECT 0
48#else
49#define OS_O_DIRECT O_DIRECT
2c0ecd28
JA
50#endif
51
74b025b0
JA
52#ifndef FIO_HAVE_HUGETLB
53#define SHM_HUGETLB 0
4d8947de 54#ifndef FIO_HUGE_PAGE
74b025b0 55#define FIO_HUGE_PAGE 0
4d8947de 56#endif
74b025b0 57#else
cb25df61 58#ifndef FIO_HUGE_PAGE
ee0e0a71 59#define FIO_HUGE_PAGE 4194304
74b025b0 60#endif
cb25df61 61#endif
74b025b0 62
07e5b264 63#ifndef FIO_HAVE_RAWBIND
8cc7afa9 64#define fio_lookup_raw(dev, majdev, mindev) 1
07e5b264
JA
65#endif
66
5e62c22a
JA
67#ifndef FIO_HAVE_BLKTRACE
68static inline int is_blktrace(const char *fname)
69{
70 return 0;
71}
72static inline int load_blktrace(struct thread_data *td, const char *fname)
73{
74 return 1;
75}
76#endif
77
ebac4655 78#endif