All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Alejandro Colomar via Libc-alpha <libc-alpha@sourceware.org>
Cc: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
	Alejandro Colomar <colomar.6.4.3@gmail.com>,
	linux-man@vger.kernel.org
Subject: Re: Bug or misdocumented feature in pthread_setaffinity_np.3
Date: Mon, 07 Sep 2020 11:24:49 +0200	[thread overview]
Message-ID: <87sgbu7xcu.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <486f9d85-2828-2b60-990c-3499b2a89559@gmail.com> (Alejandro Colomar via Libc-alpha's message of "Mon, 7 Sep 2020 11:00:05 +0200")

* Alejandro Colomar via Libc-alpha:

> pthread_setaffinity_np() and pthread_getaffinity_np(), "on error,
> return a non-zero error number".  Usually that kind of library
> functions return -1, and I don't know if this case is different.  The
> RETURN VALUE section doesn't specify. Actually the words "error
> number" hint that it is an `errno` value, because it's the same words
> in errno.3, but it could be clearer, and maybe also point to errno(3)
> in that page.

Most libpthread functions return errno codes instead of in addition to
setting errno.  This is something that POSIX requires.  The asymmetry is
annoying.  I think it dates back to the days where libpthread was purely
a library in some implementations, to be used with a C library that was
not even aware of threads and did not have a per-thread errno variable.
(Of course, that didn't work too well, but people tried.)

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill


  parent reply	other threads:[~2020-09-07  9:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-07  9:00 Bug or misdocumented feature in pthread_setaffinity_np.3 Alejandro Colomar
2020-09-07  9:21 ` Samuel Thibault
2020-09-07  9:21 ` Michael Kerrisk (man-pages)
2020-09-07  9:26   ` Alejandro Colomar
2020-09-07  9:24 ` Florian Weimer [this message]
2020-09-07  9:31   ` Michael Kerrisk (man-pages)

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=87sgbu7xcu.fsf@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=colomar.6.4.3@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.