lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 9 Sep 2008 20:45:31 +0200
From:	"Michael Kerrisk" <mtk.manpages@...glemail.com>
To:	"Chris Friesen" <cfriesen@...tel.com>
Cc:	"Denys Vlasenko" <dvlasenk@...hat.com>,
	linux-kernel@...r.kernel.org,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	"Ulrich Drepper" <drepper@...hat.com>,
	"Peter Zijlstra" <a.p.zijlstra@...llo.nl>
Subject: Re: [PATCH] make setpriority POSIX compliant; introduce PRIO_THREAD extension

Chris,

On Tue, Sep 9, 2008 at 6:42 PM, Chris Friesen <cfriesen@...tel.com> wrote:
> Michael Kerrisk wrote:
>
>> On 9/1/08, Denys Vlasenko <dvlasenk@...hat.com> wrote:
>>>
>>> Since there may be programs which use the fact that
>>>
>>> setpriority(PRIO_PROCESS, tid, value)
>>>
>>> prior to this patch was setting priority for selected thread,
>>> this behavior is retained in case when tid != pid.
>>>
>>> IOW: with PRIO_PROCESS, if pid specifies a thread group leader,
>>> all threads' prios are set. Otherwise, only selected thread's priority
>>> is set. (Alternative can be to just fail with ESRCH).
>
>
>> I would expect
>> setpriority(PRIO_PROCESS, getpid())
>> and
>> setpriority(PRIO_PROCESS, 0)
>> to have the same affect (because: which == PRIO_PRCESS, who == 0
>> conventionally means "the calling process").
>>
>> But they do not: the latter call only changes the priority of the
>> calling thread.  Is this intended?
>
> The patch interprets 0 as the current pid rather than the current tgid.
> It's up for discussion whether we should preserve old behaviour when
> specifying 0, or use a new and arguably more logical behaviour but possibly
> break old apps.

AFAICS, interpreting 0 as the TGID would be more consistent with those
parts of the interface that are specified by POSIX.1.


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ