diff options
author | San Mehat <san@google.com> | 2010-02-26 10:57:17 -0800 |
---|---|---|
committer | San Mehat <san@google.com> | 2010-02-26 11:02:31 -0800 |
commit | e2fe261d1ac775e9e6501bf976cd4fef4c1cf5dd (patch) | |
tree | 71ee37ceaa8dd9b7f13aa7bedbce3b4c58fc72c2 | |
parent | f0cb74e3b07d5de49dc875f8405e21d2a102e749 (diff) | |
download | system_core-e2fe261d1ac775e9e6501bf976cd4fef4c1cf5dd.zip system_core-e2fe261d1ac775e9e6501bf976cd4fef4c1cf5dd.tar.gz system_core-e2fe261d1ac775e9e6501bf976cd4fef4c1cf5dd.tar.bz2 |
cutils: iosched_policy: Don't do anything for simulator
Signed-off-by: San Mehat <san@google.com>
-rw-r--r-- | libcutils/iosched_policy.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; } |