Repository navigation
Commit 4dc18e7
committed
Scheduling: OR in SCHED_RESET_ON_FORK instead of ANDing it
Scheduling_setPolicy() set the reset-on-fork flag with
`policy &= SCHED_RESET_ON_FORK`. SCHED_RESET_ON_FORK is 0x40000000 and
the scheduling policies (SCHED_OTHER=0, FIFO=1, RR=2, BATCH=3, IDLE=5)
share no bits with it, so `&=` always zeroes the policy to SCHED_OTHER
and drops the flag. Enabling "Reset on fork" while choosing a real-time
policy therefore either fails with EINVAL (the RT priority no longer
matches SCHED_OTHER) or silently downgrades the process to SCHED_OTHER.
Use `|=` so the flag is combined with the chosen policy, matching the
sibling Scheduling_formatPolicy() which strips it with
`policy & ~SCHED_RESET_ON_FORK`.
Assisted-by: Claude (Anthropic)
Signed-off-by: winklemad <[email protected]>1 parent a97ad96 commit 4dc18e7
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
0 commit comments