lkml.org 
[lkml]   [2008]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] make setpriority POSIX compliant; introduce PRIO_THREAD extension
From
Date
On Mon, 2008-09-01 at 17:08 +0200, Peter Zijlstra wrote:
> On Mon, 2008-09-01 at 16:42 +0200, Denys Vlasenko wrote:
> > On Mon, 2008-09-01 at 16:12 +0200, Denys Vlasenko wrote:
> > > Patch is run tested. I will post test program etc as a reply.
> >
> > Looks like Evolution word-wrapped the patch. Let me try again.
>
> Patch looks simple enough, although a few comments below.
> Also, I guess the glibc people (Ulrich added to CC) might have an
> opinion.
>
> > Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
> > --

> > + case PRIO_PROCESS:
> > + if (who)
> > + pid = find_vpid(who);
> > + else {
> > + pid = task_pid(current);
> > + who = current->pid;
> > + }
> > + do_each_pid_thread(pid, PIDTYPE_PID, p) {
> > + if (who == p->pid || who == p->tgid) {
> > + error = set_one_prio(p, niceval, error);
> > + }
> > + } while_each_pid_thread(pid, PIDTYPE_PID, p);
>
> I worry about destroying the return value here, support one thread
> fails, but the next succeeds, should we still report failure?

Ok - got fooled by this funny set_one_prio() function. It passes the old
error value and maintains it if no new error occurs (except for -ESRCH,
but I guess people know wth they're doing).

So I'll retract my concern.



\
 
 \ /
  Last update: 2008-09-01 17:23    [W:0.092 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site