Merge "log: Fix warning with __USE_MINGW_ANSI_STDIO"
diff --git a/libcutils/iosched_policy.c b/libcutils/iosched_policy.c
index 67e101d..a6da9ca 100644
--- a/libcutils/iosched_policy.c
+++ b/libcutils/iosched_policy.c
@@ -21,31 +21,19 @@
#include <string.h>
#include <unistd.h>
-#ifdef HAVE_SCHED_H
-
#include <cutils/iosched_policy.h>
#ifdef HAVE_ANDROID_OS
-/* #include <linux/ioprio.h> */
-extern int ioprio_set(int which, int who, int ioprio);
-extern int ioprio_get(int which, int who);
+#include <linux/ioprio.h>
+#include <sys/syscall.h>
#define __android_unused
#else
#define __android_unused __attribute__((__unused__))
#endif
-enum {
- WHO_PROCESS = 1,
- WHO_PGRP,
- WHO_USER,
-};
-
-#define CLASS_SHIFT 13
-#define IOPRIO_NORM 4
-
int android_set_ioprio(int pid __android_unused, IoSchedClass clazz __android_unused, int ioprio __android_unused) {
#ifdef HAVE_ANDROID_OS
- if (ioprio_set(WHO_PROCESS, pid, ioprio | (clazz << CLASS_SHIFT))) {
+ if (syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, pid, ioprio | (clazz << IOPRIO_CLASS_SHIFT))) {
return -1;
}
#endif
@@ -56,11 +44,11 @@
#ifdef HAVE_ANDROID_OS
int rc;
- if ((rc = ioprio_get(WHO_PROCESS, pid)) < 0) {
+ if ((rc = syscall(SYS_ioprio_get, IOPRIO_WHO_PROCESS, pid)) < 0) {
return -1;
}
- *clazz = (rc >> CLASS_SHIFT);
+ *clazz = (rc >> IOPRIO_CLASS_SHIFT);
*ioprio = (rc & 0xff);
#else
*clazz = IoSchedClass_NONE;
@@ -68,5 +56,3 @@
#endif
return 0;
}
-
-#endif /* HAVE_SCHED_H */
diff --git a/rootdir/init.rc b/rootdir/init.rc
index e3a3017..484bd10 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -257,6 +257,7 @@
# create dalvik-cache, so as to enforce our permissions
mkdir /data/dalvik-cache 0771 system system
+ mkdir /data/dalvik-cache/profiles 0711 system system
# create resource-cache and double-check the perms
mkdir /data/resource-cache 0771 system system
@@ -468,7 +469,7 @@
console
disabled
user shell
- group log
+ group shell log
seclabel u:r:shell:s0
on property:ro.debuggable=1