From: Alejandro Colomar <alx@kernel.org>
To: Jakub Wilk <jwilk@jwilk.net>
Cc: Florian Weimer <fweimer@redhat.com>,
libc-help@sourceware.org, linux-man@vger.kernel.org,
Iker Pedrosa <ipedrosa@redhat.com>,
~hallyn/shadow@lists.sr.ht,
Michael Kerrisk <mtk.manpages@gmail.com>
Subject: Re: strtol(3) setting of errno
Date: Thu, 30 Nov 2023 23:45:06 +0100 [thread overview]
Message-ID: <ZWkQcuFmRe0eSDaR@debian> (raw)
In-Reply-To: <20231130221301.nteiaukktf6om6un@jwilk.net>
[-- Attachment #1: Type: text/plain, Size: 610 bytes --]
Hi Jakub,
On Thu, Nov 30, 2023 at 11:13:01PM +0100, Jakub Wilk wrote:
> * Alejandro Colomar <alx@kernel.org>, 2023-11-30 13:40:
> > 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.
>
> No? "These functions shall not change the setting of errno if successful."
Ahhh, I missed that text. Thanks! It means that a simple errno!=0 is
enough (plus the endptr check), then, and the current page is correct.
Cheers,
Alex
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2023-11-30 22:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-30 9:22 Alejandro Colomar
2023-11-30 12:00 ` Florian Weimer
2023-11-30 12:40 ` Alejandro Colomar
2023-11-30 22:13 ` Jakub Wilk
2023-11-30 22:45 ` Alejandro Colomar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZWkQcuFmRe0eSDaR@debian \
--to=alx@kernel.org \
--cc=fweimer@redhat.com \
--cc=ipedrosa@redhat.com \
--cc=jwilk@jwilk.net \
--cc=libc-help@sourceware.org \
--cc=linux-man@vger.kernel.org \
--cc=mtk.manpages@gmail.com \
--cc=~hallyn/shadow@lists.sr.ht \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).