[PATCH] Support for splice IO engine
[fio.git] / 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"
8#else
9#error "unsupported os"
10#endif
11
12#ifdef FIO_HAVE_LIBAIO
13#include <libaio.h>
14#endif
15
16#ifdef FIO_HAVE_POSIXAIO
17#include <aio.h>
18#endif
19
20#ifdef FIO_HAVE_SGIO
21#include <linux/fs.h>
22#include <scsi/sg.h>
23#endif
24
25#ifndef FIO_HAVE_FADVISE
26#define fadvise(fd, off, len, advice) (0)
27
28#define POSIX_FADV_DONTNEED (0)
29#define POSIX_FADV_SEQUENTIAL (0)
30#define POSIX_FADV_RANDOM (0)
31#endif /* FIO_HAVE_FADVISE */
32
33#ifndef FIO_HAVE_CPU_AFFINITY
34#define fio_setaffinity(td) (0)
35#define fio_getaffinity(pid, mask) (0)
36#endif
37
38#ifndef FIO_HAVE_IOPRIO
39#define ioprio_set(which, who, prio) (0)
40#endif
41
42struct thread_data;
43extern int fio_libaio_init(struct thread_data *);
44extern int fio_posixaio_init(struct thread_data *);
45extern int fio_syncio_init(struct thread_data *);
46extern int fio_mmapio_init(struct thread_data *);
47extern int fio_sgio_init(struct thread_data *);
8756e4d4 48extern int fio_spliceio_init(struct thread_data *);
ebac4655
JA
49
50#endif