From: Brian Inglis <Brian.Inglis@SystematicSW.ab.ca>
To: linux-man@vger.kernel.org
Cc: carlos@redhat.com, dj@redhat.com, eggert@cs.ucla.edu,
jens.gustedt@inria.fr, libc-alpha@sourceware.org,
rcseacord@gmail.com, vincent@vinc17.net, xry111@xry111.site,
alx@kernel.org
Subject: Re: [PATCH v3] ctime.3: EXAMPLES: Add example program
Date: Fri, 23 Aug 2024 08:04:20 -0600 [thread overview]
Message-ID: <331b41ea-dce5-414d-8588-9e4e2a59dedd@SystematicSW.ab.ca> (raw)
In-Reply-To: <daswt7u6tvj7mq4x5ntjzel5cspkyfmkphrtvsdsywoaalhrgh@7s2eedsskylp>
AFAICS from 9899 1998 Draft to 2023, the *mktime* wording has been essentially:
"The original values of the tm_wday and tm_yday components of the structure are
ignored, and the original values of the other components are not restricted to
the ranges indicated above. On successful completion, the values of the tm_wday
and tm_yday components of the structure are set appropriately,"
so the recommendation has been to do something like (pointless example):
time_t tt = time(&tt);
struct tm *tm = localtime(&tt);
tm->tm_wday = tm->tm_yday = -1;
if ((tt = mktime(tm)) == -1 && tm->tm_wday == -1 && tm->tm_yday == -1)
error(...);
--
Take care. Thanks, Brian Inglis Calgary, Alberta, Canada
La perfection est atteinte Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut
-- Antoine de Saint-Exupéry
next prev parent reply other threads:[~2024-08-23 14:11 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 23:11 [PATCH v4] ctime.3: Document how to detect invalid or ambiguous times Alejandro Colomar
[not found] ` <xned6jlywd.fsf@greed.delorie.com>
2024-08-22 23:49 ` [PATCH v3] ctime.3: EXAMPLES: Add example program Alejandro Colomar
2024-08-23 4:57 ` Paul Eggert
2024-08-23 7:02 ` Alejandro Colomar
2024-08-23 7:26 ` Xi Ruoyao
2024-08-23 7:57 ` Vincent Lefevre
2024-08-23 12:28 ` Alejandro Colomar
2024-08-23 12:28 ` Xi Ruoyao
2024-08-23 12:53 ` Vincent Lefevre
2024-08-23 13:12 ` Alejandro Colomar
2024-08-23 13:54 ` Vincent Lefevre
2024-08-23 14:18 ` Alejandro Colomar
2024-08-23 15:26 ` Vincent Lefevre
2024-08-23 17:48 ` Alejandro Colomar
2024-08-23 18:46 ` Robert Elz
2024-08-23 19:08 ` Paul Eggert
2024-08-23 20:09 ` Hans Åberg
2024-08-23 20:34 ` Alejandro Colomar
2024-08-23 14:04 ` Brian Inglis [this message]
2024-08-23 14:25 ` Alejandro Colomar
2024-08-23 18:31 ` Brian Inglis
2024-08-23 20:27 ` Alejandro Colomar
2024-08-24 8:46 ` [PATCH v5] ctime.3: Document how to detect invalid or ambiguous times Alejandro Colomar
2024-08-25 18:33 ` Alejandro Colomar
2024-08-30 11:09 ` [PATCH v6] ctime.3: EXAMPLES: " Alejandro Colomar
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=331b41ea-dce5-414d-8588-9e4e2a59dedd@SystematicSW.ab.ca \
--to=brian.inglis@systematicsw.ab.ca \
--cc=alx@kernel.org \
--cc=carlos@redhat.com \
--cc=dj@redhat.com \
--cc=eggert@cs.ucla.edu \
--cc=jens.gustedt@inria.fr \
--cc=libc-alpha@sourceware.org \
--cc=linux-man@vger.kernel.org \
--cc=rcseacord@gmail.com \
--cc=vincent@vinc17.net \
--cc=xry111@xry111.site \
/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