Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 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" | ||||
Jens Axboe | 2c0ecd2 | 2006-06-08 13:25:41 +0200 | [diff] [blame] | 8 | #elif defined(__sun__) |
9 | #include "os-solaris.h" | ||||
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 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 | |||||
Jens Axboe | 5921e80 | 2008-05-30 15:02:38 +0200 | [diff] [blame] | 27 | #ifndef FIO_HAVE_STRSEP |
Jens Axboe | 00fb3c8 | 2008-05-30 22:17:45 +0200 | [diff] [blame^] | 28 | #include "../lib/strsep.h" |
Jens Axboe | 5921e80 | 2008-05-30 15:02:38 +0200 | [diff] [blame] | 29 | #endif |
30 | |||||
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 31 | #ifndef FIO_HAVE_FADVISE |
32 | #define fadvise(fd, off, len, advice) (0) | ||||
33 | |||||
Shawn Lewis | 4d8947d | 2007-07-25 07:51:58 +0200 | [diff] [blame] | 34 | #ifndef POSIX_FADV_DONTNEED |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 35 | #define POSIX_FADV_DONTNEED (0) |
36 | #define POSIX_FADV_SEQUENTIAL (0) | ||||
37 | #define POSIX_FADV_RANDOM (0) | ||||
Shawn Lewis | 4d8947d | 2007-07-25 07:51:58 +0200 | [diff] [blame] | 38 | #endif |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 39 | #endif /* FIO_HAVE_FADVISE */ |
40 | |||||
41 | #ifndef FIO_HAVE_CPU_AFFINITY | ||||
42 | #define fio_setaffinity(td) (0) | ||||
Jens Axboe | 5921e80 | 2008-05-30 15:02:38 +0200 | [diff] [blame] | 43 | #define fio_getaffinity(pid, mask) do { } while(0) |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 44 | #endif |
45 | |||||
46 | #ifndef FIO_HAVE_IOPRIO | ||||
47 | #define ioprio_set(which, who, prio) (0) | ||||
48 | #endif | ||||
49 | |||||
Jens Axboe | 2c0ecd2 | 2006-06-08 13:25:41 +0200 | [diff] [blame] | 50 | #ifndef FIO_HAVE_ODIRECT |
Jens Axboe | 7d42476 | 2006-06-08 13:26:31 +0200 | [diff] [blame] | 51 | #define OS_O_DIRECT 0 |
52 | #else | ||||
53 | #define OS_O_DIRECT O_DIRECT | ||||
Jens Axboe | 2c0ecd2 | 2006-06-08 13:25:41 +0200 | [diff] [blame] | 54 | #endif |
55 | |||||
Jens Axboe | 74b025b | 2006-12-19 15:18:14 +0100 | [diff] [blame] | 56 | #ifndef FIO_HAVE_HUGETLB |
57 | #define SHM_HUGETLB 0 | ||||
Shawn Lewis | 4d8947d | 2007-07-25 07:51:58 +0200 | [diff] [blame] | 58 | #ifndef FIO_HUGE_PAGE |
Jens Axboe | 74b025b | 2006-12-19 15:18:14 +0100 | [diff] [blame] | 59 | #define FIO_HUGE_PAGE 0 |
Shawn Lewis | 4d8947d | 2007-07-25 07:51:58 +0200 | [diff] [blame] | 60 | #endif |
Jens Axboe | 74b025b | 2006-12-19 15:18:14 +0100 | [diff] [blame] | 61 | #else |
Jens Axboe | cb25df6 | 2007-03-23 08:23:30 +0100 | [diff] [blame] | 62 | #ifndef FIO_HUGE_PAGE |
Jens Axboe | ee0e0a7 | 2007-03-19 10:50:47 +0100 | [diff] [blame] | 63 | #define FIO_HUGE_PAGE 4194304 |
Jens Axboe | 74b025b | 2006-12-19 15:18:14 +0100 | [diff] [blame] | 64 | #endif |
Jens Axboe | cb25df6 | 2007-03-23 08:23:30 +0100 | [diff] [blame] | 65 | #endif |
Jens Axboe | 74b025b | 2006-12-19 15:18:14 +0100 | [diff] [blame] | 66 | |
Jens Axboe | 5921e80 | 2008-05-30 15:02:38 +0200 | [diff] [blame] | 67 | #ifndef FIO_O_NOATIME |
68 | #define FIO_O_NOATIME 0 | ||||
69 | #endif | ||||
70 | |||||
Jens Axboe | 07e5b26 | 2007-04-02 14:46:07 +0200 | [diff] [blame] | 71 | #ifndef FIO_HAVE_RAWBIND |
Jens Axboe | 8cc7afa | 2007-04-17 09:06:43 +0200 | [diff] [blame] | 72 | #define fio_lookup_raw(dev, majdev, mindev) 1 |
Jens Axboe | 07e5b26 | 2007-04-02 14:46:07 +0200 | [diff] [blame] | 73 | #endif |
74 | |||||
Jens Axboe | 5e62c22 | 2007-05-22 13:27:30 +0200 | [diff] [blame] | 75 | #ifndef FIO_HAVE_BLKTRACE |
76 | static inline int is_blktrace(const char *fname) | ||||
77 | { | ||||
78 | return 0; | ||||
79 | } | ||||
Jens Axboe | 5921e80 | 2008-05-30 15:02:38 +0200 | [diff] [blame] | 80 | struct thread_data; |
Jens Axboe | 5e62c22 | 2007-05-22 13:27:30 +0200 | [diff] [blame] | 81 | static inline int load_blktrace(struct thread_data *td, const char *fname) |
82 | { | ||||
83 | return 1; | ||||
84 | } | ||||
85 | #endif | ||||
86 | |||||
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 87 | #endif |