Skip to content
This repository has been archived by the owner on Jul 2, 2022. It is now read-only.

Commit

Permalink
Cope with older linux kernel headers that don't have the newer schedu…
Browse files Browse the repository at this point in the history
…ling policies defined.
  • Loading branch information
ckolivas authored and jgarzik committed Jun 14, 2011
1 parent 994c700 commit 2a7ac1b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cpu-miner.c
Expand Up @@ -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)
Expand Down

0 comments on commit 2a7ac1b

Please sign in to comment.