summaryrefslogtreecommitdiff
path: root/execute.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-02-02 12:50:04 +0100
committerLennart Poettering <lennart@poettering.net>2010-02-02 12:50:04 +0100
commit38b48754f787e7956dc97ebae6891203358a032e (patch)
treea3c6f1064d30e6921bb2454b9bbf4e5050164313 /execute.c
parent86ad3bc1ce5a6e4d007aaa390f6f7551ff7c9696 (diff)
execute: allow configuration of SCHED_RESET_ON_FORK
Diffstat (limited to 'execute.c')
-rw-r--r--execute.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/execute.c b/execute.c
index ae32bcadac..65a7fbba1e 100644
--- a/execute.c
+++ b/execute.c
@@ -347,7 +347,8 @@ int exec_spawn(const ExecCommand *command, const ExecContext *context, int *fds,
zero(param);
param.sched_priority = context->cpu_sched_priority;
- if (sched_setscheduler(0, context->cpu_sched_policy, &param) < 0) {
+ if (sched_setscheduler(0, context->cpu_sched_policy |
+ (context->cpu_sched_reset_on_fork ? SCHED_RESET_ON_FORK : 0), &param) < 0) {
r = EXIT_SETSCHEDULER;
goto fail;
}
@@ -563,9 +564,11 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
if (c->cpu_sched_set)
fprintf(f,
"%sCPUSchedulingPolicy: %s\n"
- "%sCPUSchedulingPriority: %i\n",
+ "%sCPUSchedulingPriority: %i\n"
+ "%sCPUSchedulingResetOnFork: %s\n",
prefix, sched_policy_to_string(c->cpu_sched_policy),
- prefix, c->cpu_sched_priority);
+ prefix, c->cpu_sched_priority,
+ prefix, yes_no(c->cpu_sched_reset_on_fork));
if (c->cpu_affinity_set) {
fprintf(f, "%sCPUAffinity:", prefix);