return syscall(__NR_ioprio_set, which, who, ioprio);
}
-/*
- * we want fadvise64 really, but it's so tangled... later
- */
-static inline int fadvise(int fd, loff_t offset, size_t len, int advice)
-{
-#if 0
- return syscall(__NR_fadvise64, fd, offset, offset >> 32, len, advice);
-#else
- return posix_fadvise(fd, (off_t) offset, len, advice);
-#endif
-}
-
enum {
IOPRIO_WHO_PROCESS = 1,
IOPRIO_WHO_PGRP,
#include <asm/unistd.h>
#include "fio.h"
+#include "os.h"
#define MASK (4095)
--- /dev/null
+#ifndef FIO_OS_LINUX_H
+#define FIO_OS_LINUX_H
+
+#define FIO_HAVE_LIBAIO (1)
+#define FIO_HAVE_POSIXAIO (1)
+#define FIO_HAVE_FADVISE (1)
+
+/*
+ * we want fadvise64 really, but it's so tangled... later
+ */
+static int fadvise(int fd, loff_t offset, size_t len, int advice)
+{
+#if 0
+ return syscall(__NR_fadvise64, fd, offset, offset >> 32, len, advice);
+#else
+ return posix_fadvise(fd, (off_t) offset, len, advice);
+#endif
+}
+
+#endif
--- /dev/null
+#ifndef FIO_OS_H
+#define FIO_OS_H
+
+#if defined(__linux__)
+#include "os-linux.h"
+#else
+#error "unsupported os"
+#endif
+
+#ifndef FIO_HAVE_FADVISE
+static int fadvise(int fd, loff_t offset, size_t len, int advice)
+{
+ return 0;
+}
+
+#define POSIX_FADV_DONTNEED (0)
+#define POSIX_FADV_SEQUENTIAL (0)
+#define POSIX_FADV_RANDOM (0)
+#endif /* FIO_HAVE_FADVISE */
+
+#endif