aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/portability.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/portability.h b/lib/portability.h
index d20e4099..1f5fbf6f 100644
--- a/lib/portability.h
+++ b/lib/portability.h
@@ -244,7 +244,6 @@ pid_t xfork(void);
// use toybox before they're ready to switch to host bionic.
#ifdef __BIONIC__
#include <android/log.h>
-#include <cutils/sched_policy.h>
#include <sys/system_properties.h>
#else
typedef enum android_LogPriority {
@@ -262,8 +261,6 @@ static inline int __android_log_write(int pri, const char *tag, const char *msg)
{
return -1;
}
-static inline int get_sched_policy(int tid, void *policy) {return 0;}
-static inline char *get_sched_policy_name(int policy) {return "unknown";}
#define PROP_VALUE_MAX 92
static inline int __system_property_set(const char *key, const char *value)
{
@@ -271,6 +268,15 @@ static inline int __system_property_set(const char *key, const char *value)
}
#endif
+#if defined(__BIONIC__)
+#if defined(__ANDROID_NDK__)
+static inline int get_sched_policy(int tid, void *policy) {return 0;}
+static inline char *get_sched_policy_name(int policy) {return "unknown";}
+#else
+#include <cutils/sched_policy.h>
+#endif
+#endif
+
#ifndef SYSLOG_NAMES
typedef struct {char *c_name; int c_val;} CODE;
extern CODE prioritynames[], facilitynames[];