Re: strtol(3) setting of errno

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

 



Hi Florian,

On Thu, Nov 30, 2023 at 01:00:30PM +0100, Florian Weimer wrote:
> * Alejandro Colomar:
> 
> > Now I realize that commit was probably wrong, and one needs to check
> > both errno and the return value to determine that the call failed.  Can
> > you please confirm what the correct specification of strtol(3) is?
> 
> The most detailed specification we have is the one that is in POSIX.

Since POSIX doesn't specify, I assume it allows setting errno on
success, as with any other libc function.  That includes setting errno
on a successful call that returns 0.  Which means that the errno check
must check for the specific errno values that actually mean an error of
this function.

I'll update the page.

Thanks,
Alex

> 
> Thanks,
> Florian
> 

-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature


[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