From: Alejandro Colomar <alx.manpages@gmail.com>
To: Sam James <sam@gentoo.org>
Cc: linux-man@vger.kernel.org
Subject: Re: [PATCH v3 2/2] feature_test_macros.7: document _TIME_BITS (time64)
Date: Fri, 14 Oct 2022 00:37:49 +0200 [thread overview]
Message-ID: <acdaeed5-5b0e-b799-27b7-b58a08bacbf4@gmail.com> (raw)
In-Reply-To: <20221013205852.1551042-2-sam@gentoo.org>
[-- Attachment #1.1: Type: text/plain, Size: 2168 bytes --]
On 10/13/22 22:58, Sam James wrote:
> Some notes:
> * glibc is the only libc I'm aware of implementing _TIME_BITS for time64
> compatibility. It was introduced in glibc-2.34;
>
> * musl libc made a hard switch in 1.2.0, see https://musl.libc.org/time64.html;
>
> * Using _TIME_BITS=64 with glibc requires _FILE_OFFSET_BITS=64 (which is used
> for Large File Support)! Extraordinary claims require (some) evidence, so see
> https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/features-time64.h;h=84d56ee3ff2ecfa0d2499385623f30606f84a1bf.
>
> Reference: https://wiki.gentoo.org/wiki/Project:Toolchain/time64_migration
> Reference: https://sourceware.org/pipermail/libc-alpha/2022-January/134985.html
> Signed-off-by: Sam James <sam@gentoo.org>
Patch applied.
Thanks,
Alex
> ---
> man7/feature_test_macros.7 | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/man7/feature_test_macros.7 b/man7/feature_test_macros.7
> index cdd962f7f..bcd6e6ae9 100644
> --- a/man7/feature_test_macros.7
> +++ b/man7/feature_test_macros.7
> @@ -412,6 +412,17 @@ large files with only a recompilation being required.)
> 64-bit systems naturally permit file sizes greater than 2 Gigabytes,
> and on those systems this macro has no effect.
> .TP
> +.B _TIME_BITS
> +Defining this macro with the value 64
> +changes the width of
> +.BR time_t (3type)
> +to 64-bit which allows handling of timestamps beyond
> +2038.
> +It is closely related to
> +.B _FILE_OFFSET_BITS
> +and depending on implementation, may require it set.
> +This macro is available as of glibc 2.34.
> +.TP
> .BR _BSD_SOURCE " (deprecated since glibc 2.20)"
> Defining this macro with any value causes header files to expose
> BSD-derived definitions.
> @@ -854,6 +865,10 @@ main(int argc, char *argv[])
> printf("_FILE_OFFSET_BITS defined: %d\en", _FILE_OFFSET_BITS);
> #endif
>
> +#ifdef _TIME_BITS
> + printf("_TIME_BITS defined: %d\en", _TIME_BITS);
> +#endif
> +
> #ifdef _BSD_SOURCE
> printf("_BSD_SOURCE defined\en");
> #endif
--
<http://www.alejandro-colomar.es/>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-10-13 22:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-13 20:58 [PATCH v3 1/2] time_t.3type: reference _TIME_BITS (time64) Sam James
2022-10-13 20:58 ` [PATCH v3 2/2] feature_test_macros.7: document " Sam James
2022-10-13 22:37 ` Alejandro Colomar [this message]
2022-10-13 22:39 ` [PATCH v3 1/2] time_t.3type: reference " 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=acdaeed5-5b0e-b799-27b7-b58a08bacbf4@gmail.com \
--to=alx.manpages@gmail.com \
--cc=linux-man@vger.kernel.org \
--cc=sam@gentoo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox