Add directio support to Solaris
[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
5921e80c 27#ifndef FIO_HAVE_STRSEP
00fb3c8d 28#include "../lib/strsep.h"
5921e80c
JA
29#endif
30
ebac4655
JA
31#ifndef FIO_HAVE_FADVISE
32#define fadvise(fd, off, len, advice) (0)
33
4d8947de 34#ifndef POSIX_FADV_DONTNEED
ebac4655
JA
35#define POSIX_FADV_DONTNEED (0)
36#define POSIX_FADV_SEQUENTIAL (0)
37#define POSIX_FADV_RANDOM (0)
4d8947de 38#endif
ebac4655
JA
39#endif /* FIO_HAVE_FADVISE */
40
41#ifndef FIO_HAVE_CPU_AFFINITY
42#define fio_setaffinity(td) (0)
5921e80c 43#define fio_getaffinity(pid, mask) do { } while(0)
ebac4655
JA
44#endif
45
46#ifndef FIO_HAVE_IOPRIO
47#define ioprio_set(which, who, prio) (0)
48#endif
49
2c0ecd28 50#ifndef FIO_HAVE_ODIRECT
7d424763
JA
51#define OS_O_DIRECT 0
52#else
53#define OS_O_DIRECT O_DIRECT
2c0ecd28
JA
54#endif
55
74b025b0
JA
56#ifndef FIO_HAVE_HUGETLB
57#define SHM_HUGETLB 0
4d8947de 58#ifndef FIO_HUGE_PAGE
74b025b0 59#define FIO_HUGE_PAGE 0
4d8947de 60#endif
74b025b0 61#else
cb25df61 62#ifndef FIO_HUGE_PAGE
ee0e0a71 63#define FIO_HUGE_PAGE 4194304
74b025b0 64#endif
cb25df61 65#endif
74b025b0 66
5921e80c
JA
67#ifndef FIO_O_NOATIME
68#define FIO_O_NOATIME 0
69#endif
70
07e5b264 71#ifndef FIO_HAVE_RAWBIND
8cc7afa9 72#define fio_lookup_raw(dev, majdev, mindev) 1
07e5b264
JA
73#endif
74
5e62c22a
JA
75#ifndef FIO_HAVE_BLKTRACE
76static inline int is_blktrace(const char *fname)
77{
78 return 0;
79}
5921e80c 80struct thread_data;
5e62c22a
JA
81static inline int load_blktrace(struct thread_data *td, const char *fname)
82{
83 return 1;
84}
85#endif
86
ebac4655 87#endif