aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpu-miner.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cpu-miner.c b/cpu-miner.c
index a3de4b9..29af042 100644
--- a/cpu-miner.c
+++ b/cpu-miner.c
@@ -40,8 +40,12 @@ static inline void drop_policy(void)
{
struct sched_param param;
+#ifdef SCHED_IDLE
if (unlikely(sched_setscheduler(0, SCHED_IDLE, &param) == -1))
+#endif
+#ifdef SCHED_BATCH
sched_setscheduler(0, SCHED_BATCH, &param);
+#endif
}
static inline void affine_to_cpu(int id, int cpu)