From: prj@po.cwru.edu (Paul Jarc)
Subject: Re: stime.c forcing errno
Date: Fri, 13 Feb 2004 22:52:34 -0500 [thread overview]
Message-ID: <m3ad3mtizr.fsf@multivac.cwru.edu> (raw)
In-Reply-To: <87fzdeplm0.fsf@zip.com.au> (Kevin Ryde's message of "Sat, 14 Feb 2004 10:09:59 +1000")
Kevin Ryde <user42@zip.com.au> wrote:
> I'm not sure what the standards say about these time functions setting
> errno.
<URL:http://www.opengroup.org/onlinepubs/007904975/functions/localtime.html>:
# If an error is detected, localtime() shall return a null pointer and
# set errno to indicate the error.
<URL:http://www.opengroup.org/onlinepubs/007904975/functions/gmtime.html>:
# If an error is detected, gmtime() shall return a null pointer and
# set errno to indicate the error.
<URL:http://www.opengroup.org/onlinepubs/007904975/functions/mktime.html>:
# No errors are defined.
<URL:http://www.opengroup.org/onlinepubs/007904975/functions/strptime.html>:
# No errors are defined.
<URL:http://www.opengroup.org/onlinepubs/007904975/functions/errno.html>:
# The value of errno shall be defined only after a call to a function
# for which it is explicitly stated to be set
So for localtime/gmtime, set errno beforehand just in case libc fails
to conform. But for mktime/strptime, test for failure afterwards and
set errno in that case. Setting it beforehand may not help; since
these functions are not documented to have any particular effect on
errno, they might have any effect at all - such as replacing our
EINVAL with something nonsensical.
paul
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2004-02-14 3:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-14 0:09 stime.c forcing errno Kevin Ryde
2004-02-14 3:52 ` Paul Jarc [this message]
2004-02-14 3:58 ` Paul Jarc
2004-02-14 22:54 ` Kevin Ryde
2004-02-23 19:32 ` Marius Vollmer
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3ad3mtizr.fsf@multivac.cwru.edu \
--to=prj@po.cwru.edu \
/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).