diff options
author | Elliott Hughes <enh@google.com> | 2019-05-01 15:28:21 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-05-02 11:19:05 -0500 |
commit | d234c98318dc3e85c01092ddadfc9e7acddbbaef (patch) | |
tree | cf27b01be99c6291cddf44a00742642d4843fad9 /lib | |
parent | 2497ecaf7d1e4c2a7b72f79e3497c758bde7c93a (diff) | |
download | toybox-d234c98318dc3e85c01092ddadfc9e7acddbbaef.tar.gz |
Android moved the scheduler policy functions in Q.
They're forwarded to libprocessgroup, but we may as well go straight to
the source since neither library is in the NDK anyway.
This code is unfortunate because it means that even `toybox true` ends
up pulling in a JSON parser at runtime, because ps might call
get_sched_policy/get_sched_policy_name. I'll experiment with
dlopen-on-demand in portability.c and see whether the savings are
worthwhile, but for now at least use the current library directly so we
can save *one* dlopen!
Diffstat (limited to 'lib')
-rw-r--r-- | lib/portability.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/portability.h b/lib/portability.h index 07160e9d..96458266 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -272,9 +272,9 @@ static inline int __system_property_set(const char *key, const char *value) } #endif -// libcutils is in AOSP but not Android NDK r18 +// libprocessgroup is an Android platform library not included in the NDK. #if defined(__BIONIC__) && !defined(__ANDROID_NDK__) -#include <cutils/sched_policy.h> +#include <processgroup/sched_policy.h> #else static inline int get_sched_policy(int tid, void *policy) {return 0;} static inline char *get_sched_policy_name(int policy) {return "unknown";} |