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 | |
| 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 | |
Jens Axboe | 2c0ecd2 | 2006-06-08 13:25:41 +0200 | [diff] [blame] | 44 | #ifndef FIO_HAVE_ODIRECT |
Jens Axboe | 7d42476 | 2006-06-08 13:26:31 +0200 | [diff] [blame] | 45 | #define OS_O_DIRECT 0 |
| 46 | #else |
| 47 | #define OS_O_DIRECT O_DIRECT |
Jens Axboe | 2c0ecd2 | 2006-06-08 13:25:41 +0200 | [diff] [blame] | 48 | #endif |
| 49 | |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 50 | struct thread_data; |
| 51 | extern int fio_libaio_init(struct thread_data *); |
| 52 | extern int fio_posixaio_init(struct thread_data *); |
| 53 | extern int fio_syncio_init(struct thread_data *); |
| 54 | extern int fio_mmapio_init(struct thread_data *); |
| 55 | extern int fio_sgio_init(struct thread_data *); |
Jens Axboe | 8756e4d | 2006-05-27 20:24:53 +0200 | [diff] [blame] | 56 | extern int fio_spliceio_init(struct thread_data *); |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 57 | |
| 58 | #endif |