From: Collin Funk <collin.funk1@gmail.com>
To: Alejandro Colomar <alx@kernel.org>
Cc: linux-man@vger.kernel.org, libc-alpha@sourceware.org
Subject: Re: POSIX.1-2024 requires 64-bit time_t
Date: Sun, 18 May 2025 09:54:23 -0700 [thread overview]
Message-ID: <87plg5hnb4.fsf@gmail.com> (raw)
In-Reply-To: <zagbrxifsyor6bxzkqi7b66ixw3q67vez2nng7aqjpykkohph3@plmaq4pfz3yf>
Hi Alejandro,
Alejandro Colomar <alx@kernel.org> writes:
> POSIX.1-2024 seems to require a 64-bit (or wider) time_t. I don't know
> how's the state of things as of now in glibc, so would you mind checking
> the time_t(3type) manual page and letting me know if anything needs to
> be updated or moved to history?
>
> At first glancce, I see
>
> DESCRIPTION
> time_t Used for time in seconds. According to POSIX,
> it is an integer type.
>
> where I'll have to append "of at least 64 bits". Then, there's
>
> NOTES
> On some architectures, the width of time_t can be
> controlled with the feature test macro _TIME_BITS.
> See feature_test_macros(7).
>
> Which sounds redundant with the new requirements. That sounds like it's
> for architectures that are non-conforming only, right? In the
> conforming ones, it wouldn't make sense. So, we'll need to clarify
> which architectures are conforming and which are not. Please let me
> know.
I documented this in glibc in commit
363bbdbd2aeaae1e00f3872f2ba19a4a3c17bdf1:
manual: Mention POSIX-1.2024 requires time_t to be 64 bit or wider.
* manual/time.texi (Time Types): Mention POSIX-1.2024 requires 64 bit
time_t.
Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
But as you mention and as documented in the manual, some older platforms
default to 32-bits unless _TIME_BITS is set to 64:
Currently the @code{time_t} type is 64 bits wide on all platforms
supported by @theglibc{}, except that it is 32 bits wide on a few
older platforms unless you define @code{_TIME_BITS} to 64.
I'll have to investigate the full list of architectures which that is
the case.
Collin
next prev parent reply other threads:[~2025-05-18 16:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-18 9:58 POSIX.1-2024 requires 64-bit time_t Alejandro Colomar
2025-05-18 16:54 ` Collin Funk [this message]
2025-05-18 21:52 ` Mark Harris
2025-05-18 22:06 ` Alejandro Colomar
2025-05-18 22:09 ` Mark Harris
2025-05-18 22:13 ` Alejandro Colomar
2025-05-18 22:46 ` Collin Funk
2025-05-19 11:31 ` Andreas K. Huettel
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=87plg5hnb4.fsf@gmail.com \
--to=collin.funk1@gmail.com \
--cc=alx@kernel.org \
--cc=libc-alpha@sourceware.org \
--cc=linux-man@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.