public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Bug or misdocumented feature in pthread_setaffinity_np.3
@ 2020-09-07  9:00 Alejandro Colomar
  2020-09-07  9:21 ` Samuel Thibault
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alejandro Colomar @ 2020-09-07  9:00 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man, libc-alpha

Hello Michael,

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.

In the EXAMPLES section, however, the return value is used as if it were 
an `errno` value, printing the corresponding string with perror().

Is that example printing random strings (a bug)?

Or is it that those functions return an error code that corresponds to a 
valid `errno` error number?  In that case it could be documented better 
IMHO.

If that is the case, do those functions set `errno` and also return that 
same `errno` value redundantly?


Thanks,

Alex.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-07  9:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2020-09-07  9:31   ` Michael Kerrisk (man-pages)

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 read-only IMAP folder(s) and NNTP newsgroup(s).