diff options
-rw-r--r-- | util-linux/chrt.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/util-linux/chrt.c b/util-linux/chrt.c index ede92310f..4dd78dabf 100644 --- a/util-linux/chrt.c +++ b/util-linux/chrt.c | |||
@@ -135,6 +135,17 @@ int chrt_main(int argc UNUSED_PARAM, char **argv) | |||
135 | pol = sched_getscheduler(pid); | 135 | pol = sched_getscheduler(pid); |
136 | if (pol < 0) | 136 | if (pol < 0) |
137 | bb_perror_msg_and_die("can't %cet pid %u's policy", 'g', (int)pid); | 137 | bb_perror_msg_and_die("can't %cet pid %u's policy", 'g', (int)pid); |
138 | #ifdef SCHED_RESET_ON_FORK | ||
139 | /* "Since Linux 2.6.32, the SCHED_RESET_ON_FORK flag | ||
140 | * can be ORed in policy when calling sched_setscheduler(). | ||
141 | * As a result of including this flag, children created by | ||
142 | * fork(2) do not inherit privileged scheduling policies" | ||
143 | * | ||
144 | * This bit is also returned by sched_getscheduler()! | ||
145 | * (TODO: do we want to show it?) | ||
146 | */ | ||
147 | pol &= ~SCHED_RESET_ON_FORK; | ||
148 | #endif | ||
138 | printf("pid %u's %s scheduling policy: SCHED_%s\n", | 149 | printf("pid %u's %s scheduling policy: SCHED_%s\n", |
139 | pid, current_new, policy_name(pol) | 150 | pid, current_new, policy_name(pol) |
140 | ); | 151 | ); |