Fix non-Android build targets

Non-Android build targets are missing sys/prctl.h header and functionality
should be disabled for them like it was done previously inside
sched_policy.cpp. Also make the set_sched_policy/get_sched_policy
functionality backward compatible by creating stubs for non-Android
targets.

Bug: 111307099
Test: built sdk_gphone_x86-sdk_addon_mac target using forrest

Change-Id: I1c195267e287a84a21c588bd61d7c452bff6cfbe
Merged-In: I1c195267e287a84a21c588bd61d7c452bff6cfbe
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
diff --git a/libprocessgroup/sched_policy.cpp b/libprocessgroup/sched_policy.cpp
index 4c8aa6d..337b032 100644
--- a/libprocessgroup/sched_policy.cpp
+++ b/libprocessgroup/sched_policy.cpp
@@ -36,6 +36,8 @@
     return p == SP_DEFAULT ? SP_SYSTEM_DEFAULT : p;
 }
 
+#if defined(__ANDROID__)
+
 int set_cpuset_policy(int tid, SchedPolicy policy) {
     if (tid == 0) {
         tid = GetThreadId();
@@ -195,6 +197,21 @@
     return 0;
 }
 
+#else
+
+/* Stubs for non-Android targets. */
+
+int set_sched_policy(int, SchedPolicy) {
+    return 0;
+}
+
+int get_sched_policy(int, SchedPolicy* policy) {
+    *policy = SP_SYSTEM_DEFAULT;
+    return 0;
+}
+
+#endif
+
 const char* get_sched_policy_name(SchedPolicy policy) {
     policy = _policy(policy);
     static const char* const kSchedPolicyNames[] = {