Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28956
b: refs/heads/master
c: e7834f8
h: refs/heads/master
v: v3
  • Loading branch information
David Quigley authored and Linus Torvalds committed Jun 23, 2006
1 parent 6bf30db commit c93b182
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 03e68060636e05989ea94bcb671ab633948f328c
refs/heads/master: e7834f8fccd791225a1cf91c2c3e740ad8e2e145
9 changes: 8 additions & 1 deletion trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -3886,6 +3886,10 @@ long sched_setaffinity(pid_t pid, cpumask_t new_mask)
!capable(CAP_SYS_NICE))
goto out_unlock;

retval = security_task_setscheduler(p, 0, NULL);
if (retval)
goto out_unlock;

cpus_allowed = cpuset_cpus_allowed(p);
cpus_and(new_mask, new_mask, cpus_allowed);
retval = set_cpus_allowed(p, new_mask);
Expand Down Expand Up @@ -3954,7 +3958,10 @@ long sched_getaffinity(pid_t pid, cpumask_t *mask)
if (!p)
goto out_unlock;

retval = 0;
retval = security_task_getscheduler(p);
if (retval)
goto out_unlock;

cpus_and(*mask, p->cpus_allowed, cpu_online_map);

out_unlock:
Expand Down

0 comments on commit c93b182

Please sign in to comment.