Re: Bug or misdocumented feature in pthread_setaffinity_np.3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* 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




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux