From e2fe261d1ac775e9e6501bf976cd4fef4c1cf5dd Mon Sep 17 00:00:00 2001 From: San Mehat Date: Fri, 26 Feb 2010 10:57:17 -0800 Subject: cutils: iosched_policy: Don't do anything for simulator Signed-off-by: San Mehat --- libcutils/iosched_policy.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libcutils/iosched_policy.c b/libcutils/iosched_policy.c index 4004a2a..7203e51 100644 --- a/libcutils/iosched_policy.c +++ b/libcutils/iosched_policy.c @@ -40,13 +40,16 @@ enum { #define IOPRIO_NORM 4 int android_set_ioprio(int pid, IoSchedClass clazz, int ioprio) { +#ifdef HAVE_ANDROID_OS if (ioprio_set(WHO_PROCESS, pid, ioprio | (clazz << CLASS_SHIFT))) { return -1; } +#endif return 0; } int android_get_ioprio(int pid, IoSchedClass *clazz, int *ioprio) { +#ifdef HAVE_ANDROID_OS int rc; if ((rc = ioprio_get(WHO_PROCESS, pid)) < 0) { @@ -55,6 +58,10 @@ int android_get_ioprio(int pid, IoSchedClass *clazz, int *ioprio) { *clazz = (rc >> CLASS_SHIFT); *ioprio = (rc & 0xff); +#else + *clazz = IoSchedClass_NONE; + *ioprio = 0; +#endif return 0; } -- cgit v1.1