diff options
author | Denys Vlasenko | 2019-04-05 16:59:07 +0200 |
---|---|---|
committer | Denys Vlasenko | 2019-04-05 16:59:07 +0200 |
commit | 43d09e79db91110e7ca09610efd0b62fce453b47 (patch) | |
tree | 84e5860ca38d44d1de748271d0e437e8b9ac465e | |
parent | ae5ca6fc417161eb514103d3c2b38add18012760 (diff) | |
download | busybox-43d09e79db91110e7ca09610efd0b62fce453b47.zip busybox-43d09e79db91110e7ca09610efd0b62fce453b47.tar.gz |
chrt: fix for SCHED_RESET_ON_FORK bit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-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 ede9231..4dd78da 100644 --- a/util-linux/chrt.c +++ b/util-linux/chrt.c @@ -135,6 +135,17 @@ int chrt_main(int argc UNUSED_PARAM, char **argv) pol = sched_getscheduler(pid); if (pol < 0) bb_perror_msg_and_die("can't %cet pid %u's policy", 'g', (int)pid); +#ifdef SCHED_RESET_ON_FORK + /* "Since Linux 2.6.32, the SCHED_RESET_ON_FORK flag + * can be ORed in policy when calling sched_setscheduler(). + * As a result of including this flag, children created by + * fork(2) do not inherit privileged scheduling policies" + * + * This bit is also returned by sched_getscheduler()! + * (TODO: do we want to show it?) + */ + pol &= ~SCHED_RESET_ON_FORK; +#endif printf("pid %u's %s scheduling policy: SCHED_%s\n", pid, current_new, policy_name(pol) ); |