Bug or misdocumented feature in pthread_setaffinity_np.3

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

 



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.



[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