summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-10-13 21:58:52 +0100
committerAlejandro Colomar <alx@kernel.org>2022-10-14 00:36:23 +0200
commit4bcd68c90380082490d7aee9ff36f56bb1853b0e (patch)
tree26db447095d2b37c51e17d970ec3e306e0878241
parent1bc8ca06c40df557c380c9bb0adb16af3ec23c6f (diff)
feature_test_macros.7: document _TIME_BITS (time64)
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> Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man7/feature_test_macros.715
1 files changed, 15 insertions, 0 deletions
diff --git a/man7/feature_test_macros.7 b/man7/feature_test_macros.7
index 338683911..2a0d8be2a 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.
@@ -870,6 +881,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