14065cd2de7a11dc28f646416e47e14324f89020
[disktools.git] / os.h
1 #ifndef FIO_OS_H
2 #define FIO_OS_H
3
4 #if defined(__linux__)
5 #include "os-linux.h"
6 #else
7 #error "unsupported os"
8 #endif
9
10 #ifdef FIO_HAVE_LIBAIO
11 #include <libaio.h>
12 #endif
13
14 #ifdef FIO_HAVE_POSIXAIO
15 #include <aio.h>
16 #endif
17
18 #ifndef FIO_HAVE_FADVISE
19 static int fadvise(int fd, loff_t offset, size_t len, int advice)
20 {
21         return 0;
22 }
23
24 #define POSIX_FADV_DONTNEED     (0)
25 #define POSIX_FADV_SEQUENTIAL   (0)
26 #define POSIX_FADV_RANDOM       (0)
27 #endif /* FIO_HAVE_FADVISE */
28
29 #ifndef FIO_HAVE_CPU_AFFINITY
30 #define fio_setaffinity(td)     do { } while (0)
31 #endif
32
33 struct thread_data;
34 extern int fio_libaio_init(struct thread_data *);
35 extern void fio_libaio_cleanup(struct thread_data *);
36 extern int fio_posixaio_init(struct thread_data *);
37 extern void fio_posixaio_cleanup(struct thread_data *);
38
39 #endif