blob: 660dcc5202dc948e430224bdc33591dda9591dbf [file] [log] [blame]
Jens Axboeebac4652005-12-08 15:25:21 +01001#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 Axboe2c0ecd22006-06-08 13:25:41 +02008#elif defined(__sun__)
9#include "os-solaris.h"
Jens Axboeebac4652005-12-08 15:25:21 +010010#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 Axboe2c0ecd22006-06-08 13:25:41 +020044#ifndef FIO_HAVE_ODIRECT
Jens Axboe7d424762006-06-08 13:26:31 +020045#define OS_O_DIRECT 0
46#else
47#define OS_O_DIRECT O_DIRECT
Jens Axboe2c0ecd22006-06-08 13:25:41 +020048#endif
49
Jens Axboe74b025b2006-12-19 15:18:14 +010050#ifndef FIO_HAVE_HUGETLB
51#define SHM_HUGETLB 0
52#define FIO_HUGE_PAGE 0
53#else
Jens Axboecb25df62007-03-23 08:23:30 +010054#ifndef FIO_HUGE_PAGE
Jens Axboeee0e0a72007-03-19 10:50:47 +010055#define FIO_HUGE_PAGE 4194304
Jens Axboe74b025b2006-12-19 15:18:14 +010056#endif
Jens Axboecb25df62007-03-23 08:23:30 +010057#endif
Jens Axboe74b025b2006-12-19 15:18:14 +010058
Jens Axboe07e5b262007-04-02 14:46:07 +020059#ifndef FIO_HAVE_RAWBIND
Jens Axboe8cc7afa2007-04-17 09:06:43 +020060#define fio_lookup_raw(dev, majdev, mindev) 1
Jens Axboe07e5b262007-04-02 14:46:07 +020061#endif
62
Jens Axboe5e62c222007-05-22 13:27:30 +020063#ifndef FIO_HAVE_BLKTRACE
64static inline int is_blktrace(const char *fname)
65{
66 return 0;
67}
68static inline int load_blktrace(struct thread_data *td, const char *fname)
69{
70 return 1;
71}
72#endif
73
Jens Axboeebac4652005-12-08 15:25:21 +010074#endif