Fio 2.8
[fio.git] / os / os-android.h
index 954178ddaecf3c25805db4e55a22ab104f570b69..1699539cad2a1a525cbec6f98f8ee449f16004af 100644 (file)
@@ -4,6 +4,7 @@
 #define        FIO_OS  os_android
 
 #include <sys/ioctl.h>
+#include <sys/mman.h>
 #include <sys/uio.h>
 #include <sys/syscall.h>
 #include <sys/vfs.h>
 
 #define OS_MAP_ANON            MAP_ANONYMOUS
 
+#ifndef POSIX_MADV_DONTNEED
 #define posix_madvise   madvise
 #define POSIX_MADV_DONTNEED MADV_DONTNEED
 #define POSIX_MADV_SEQUENTIAL  MADV_SEQUENTIAL
 #define POSIX_MADV_RANDOM      MADV_RANDOM
+#endif
+
 #ifdef MADV_REMOVE
 #define FIO_MADV_FREE  MADV_REMOVE
 #endif
@@ -234,7 +238,7 @@ static inline int arch_cache_line_size(void)
                return atoi(size);
 }
 
-static inline unsigned long long get_fs_size(const char *path)
+static inline unsigned long long get_fs_free_size(const char *path)
 {
        unsigned long long ret;
        struct statfs s;
@@ -261,4 +265,12 @@ static inline int os_trim(int fd, unsigned long long start,
        return errno;
 }
 
+#ifdef CONFIG_SCHED_IDLE
+static inline int fio_set_sched_idle(void)
+{
+        struct sched_param p = { .sched_priority = 0, };
+        return sched_setscheduler(gettid(), SCHED_IDLE, &p);
+}
+#endif
+
 #endif