aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/portability.c6
-rw-r--r--lib/portability.h7
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/portability.c b/lib/portability.c
index 78e500b1..f4354a86 100644
--- a/lib/portability.c
+++ b/lib/portability.c
@@ -92,3 +92,9 @@ int clearenv(void)
return 0;
}
#endif
+
+#if !defined(__ANDROID__)
+// No-op implementations of <cutils/sched_policy.h>.
+int get_sched_policy(int tid, SchedPolicy *policy) { return 0; }
+const char *get_sched_policy_name(SchedPolicy policy) { return "unknown"; }
+#endif
diff --git a/lib/portability.h b/lib/portability.h
index fdee5fcf..87258fa9 100644
--- a/lib/portability.h
+++ b/lib/portability.h
@@ -270,3 +270,10 @@ pid_t xfork(void);
//#define strncpy(...) @@strncpyisbadmmkay@@
//#define strncat(...) @@strncatisbadmmkay@@
+#ifdef __ANDROID__
+#include <cutils/sched_policy.h>
+#else
+typedef int SchedPolicy;
+int get_sched_policy(int tid, SchedPolicy *policy);
+const char *get_sched_policy_name(SchedPolicy policy);
+#endif