diff options
author | Elliott Hughes <enh@google.com> | 2016-04-29 18:04:20 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2016-04-30 20:15:51 -0500 |
commit | e0dbc6beaf376f1a84464e103661840178576b84 (patch) | |
tree | 0c79b2cccfc2854a5cca318a95e7c053c7825002 /lib | |
parent | ec863082bfef526d0a02ab6823c967fbaba5dd74 (diff) | |
download | toybox-e0dbc6beaf376f1a84464e103661840178576b84.tar.gz |
Add a ps "PCY" field for Android scheduling policy.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/portability.c | 6 | ||||
-rw-r--r-- | lib/portability.h | 7 |
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 |