Hi Christian,

On Dec 10 15:16, Christian Franke wrote:
> +  /* Handle SCHED_RESET_ON_FORK flag. */
> +  if (myself->sched_reset_on_fork)
> +    {
> +      bool batch = (myself->sched_policy == SCHED_BATCH);
> +      bool idle = (myself->sched_policy == SCHED_IDLE);
> +      bool set_prio = false;
> +      /* Reset negative nice values to zero. */
> +      if (myself->nice < 0)
> +     {
> +       child->nice = 0;
> +       set_prio = !idle;
> +     }
> +      /* Reset realtime policies to SCHED_OTHER. */
> +      if (!(myself->sched_policy == SCHED_OTHER || batch || idle))
> +     {
> +       child->sched_policy = SCHED_OTHER;
> +       set_prio = true;
> +     }
> +      /* Adjust Windows priority if required. */
> +      if (set_prio)
> +     {
> +       HANDLE proc = OpenProcess(PROCESS_SET_INFORMATION |
> +                                 PROCESS_QUERY_LIMITED_INFORMATION,
> +                                 FALSE, child->dwProcessId);
> +       if (proc)
> +         {
> +           set_and_check_winprio(proc, nice_to_winprio(child->nice, batch));
> +           CloseHandle(proc);
> +         }
> +     }
> +    }
> +  child->sched_reset_on_fork = false;
> +

Is it really necessary to go to such length here?  For one thing, we
have hchild aka pi.hProcess, which should have all access rights on the
child.  Otherwise, the priority of the child process can be set in the
dwCreationFlags parameter, called `c_flags' in frok::parent().  See line
215 in fork.cc.

In terms of the SCHED_BATCH value, I'm not going to wait much longer.
If there's no reply on the newlib list tomorrow, I'll push your patch
with SCHED_BATCH set to 6.


Thanks,
Corinna

Reply via email to