From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: mtk.manpages@gmail.com,
"linux-man@vger.kernel.org" <linux-man@vger.kernel.org>
Subject: Re: Documentation error for "sched_getaffinity"
Date: Wed, 25 Sep 2019 14:42:08 +0200 [thread overview]
Message-ID: <9097aaf8-e7f6-d173-9148-1f58ca6498f5@gmail.com> (raw)
In-Reply-To: <e5e7506b47e8442492478aadf289979b@mbx03.liveapp.local>
Hello Marc,
On 9/25/19 11:33 AM, Marc Brandis wrote:
> Hello,
>
> I noticed the following documentation error in the online man pages
> (man7.org) for the "sched_getaffinity(2)" system call. It incorrectly
> says that sched_getaffinity returns 0 on success; instead it returns
> the number of bits in the CPU set, which I assume is the number of
I think you mean "bytes", not "bits"
> CPUs (incl. hyperthreading) the system has.
> I am running on Linux kernel 4.15.0-62 in Ubuntu build 18.04. I came
> across it when debugging a multi-threaded program using the call, and
> that program passing a large buffer for the cpuset parameter (8
> kBytes).
>
> It is not just a typo or grammar issue, but I still was not sure
> whether this should be reported through Bugzilla.
The explanation for what you are seeing is actually covered
lower in the page:
C library/kernel differences
...
On success, the raw sched_getaffinity() system call returns the
number of bytes placed copied into the mask buffer; this will be
the minimum of cpusetsize and the size (in bytes) of the cpumask_t
data type that is used internally by the kernel to represent the
CPU set bit mask.
But, you're not the first to miss this detail, so I've just now modified
the RETURN VALUE section to make it easier for people to find that text:
On success, sched_setaffinity() and sched_getaffinity() return 0
(but see "C library/kernel differences" below, which notes that
the underlying sched_getaffinity() differs in its return value).
Thanks,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
parent reply other threads:[~2019-09-25 12:42 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <e5e7506b47e8442492478aadf289979b@mbx03.liveapp.local>]
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=9097aaf8-e7f6-d173-9148-1f58ca6498f5@gmail.com \
--to=mtk.manpages@gmail.com \
--cc=linux-man@vger.kernel.org \
/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.
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).