diff options
author | ckolivas <kernel@kolivas.org> | 2011-06-14 14:09:10 +1000 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2011-06-14 02:35:59 -0400 |
commit | 2a7ac1bce7167b967daa4f344f1d67bb1933ab17 (patch) | |
tree | e64c3bc88614d154ce59500b97704f376fe61f2f | |
parent | 994c700ff4b029ce693a57e53c6870ec4acce907 (diff) |
Cope with older linux kernel headers that don't have the newer scheduling policies defined.
-rw-r--r-- | cpu-miner.c | 4 |
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, ¶m) == -1)) +#endif +#ifdef SCHED_BATCH sched_setscheduler(0, SCHED_BATCH, ¶m); +#endif } static inline void affine_to_cpu(int id, int cpu) |