Re: [patch] ptsname.3: Fix description of failure behaviour of ptsname_r

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

 



On Sat, Jan 26, 2019 at 09:22:59PM +0100, Bruno Haible wrote:
> Rich Felker wrote:
> > I would prefer something like:
> > 
> >   "glibc historically stores the error number in errno in addition to
> >   returning it. Assuming this behavior is not portable; applications
> >   should use the return value, not errno, to determine the result."
> 
> I claim that "applications should use the return value, not errno, to
> determine the result" independently of whether the glibc maintainers
> decide to keep the current "historical" behaviour or not. Simply because
> the new text that is scheduled to be included in POSIX Issue 8 does
> not mention 'errno' here.

Agreed.

> > Non-setting of errno is not part of the contract of the musl libc
> > implementation of this function
> 
> Nonetheless, I find it worth mentioning in the comments (not the text)
> of the man page, simply because musl libc is currently the most
> important libc available for Linux that does not set 'errno' here.

Indeed, I'm not opposed to mentioning that the distinction may be
important for portability to musl. I just mean that non-setting of
errno isn't a documented/guaranteed property of the implementation in
musl (by default, interfaces are allowed to clobber errno arbitrarily
except for setting it to 0, and setting it based on the result being
returned would be one way to clobber it) so it could change in the
future. So "might not" rather than "does not" would be better wording.

Rich



[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