From 93eeb5582d56fe5e36f455c8de26c302e317fdeb Mon Sep 17 00:00:00 2001 From: enh Date: Wed, 25 Feb 2015 14:00:01 -0700 Subject: [PATCH] Fix implicit function declaration on Android there's no fio_set_sched_idle in os/os-android.h. copy the one from os/os-linux.h. current Android also has posix_madvise. Signed-off-by: Jens Axboe --- os/os-android.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/os/os-android.h b/os/os-android.h index 954178dd..b4f4f134 100644 --- a/os/os-android.h +++ b/os/os-android.h @@ -4,6 +4,7 @@ #define FIO_OS os_android #include +#include #include #include #include @@ -37,10 +38,13 @@ #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 @@ -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 -- 2.25.1