From: Rich Felker <dalias@aerifal.cx>
To: Justine Tunney <jart@google.com>
Cc: musl@lists.openwall.com
Subject: Re: musl nice() posix compliance issue
Date: Sun, 15 Apr 2018 14:58:16 -0400 [thread overview]
Message-ID: <20180415185816.GW3094@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAKTZs+oqBk6M8JihSTPQphrLTL18EOnjvp+Atwd6a5NMLn0o=Q@mail.gmail.com>
On Sun, Apr 15, 2018 at 10:17:37AM -0700, Justine Tunney wrote:
> According to Python 2.7 autoconf, musl's nice() function needs to do this.
> I checked latest release and HEAD.
>
> C library/kernel differences
> POSIX.1 specifies that nice() should return the new nice value.
> However, the raw Linux system call returns 0 on success. Likewise, the
> nice() wrapper function provided in glibc 2.2.3 and
> earlier returns 0 on success.
This analysis seems correct, and from what I can tell, the SYS_nice
syscall simply isn't usable to implement nice() because it doesn't
provide the resulting nice level. So I think we have to fully drop use
of it. OTOH SYS_get/setpriority are also problematic because of
non-atomicity; we can and probably should try to patch that up by
blocking signals and taking a lock around the operation -- but I'm not
sure Linux even correctly applies the priority to all threads rather
than just the calling thread, anyway... Do you know?
Rich
next parent reply other threads:[~2018-04-15 18:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAKTZs+oqBk6M8JihSTPQphrLTL18EOnjvp+Atwd6a5NMLn0o=Q@mail.gmail.com>
2018-04-15 18:58 ` Rich Felker [this message]
2018-04-16 21:35 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180415185816.GW3094@brightrain.aerifal.cx \
--to=dalias@aerifal.cx \
--cc=jart@google.com \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).