Re: [PATCH v2 2/2] feature_test_macros.7: document _TIME_BITS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sam,

On 10/13/22 20:30, Sam James wrote:
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@xxxxxxxxxx>
---
  man7/feature_test_macros.7 | 13 +++++++++++++
  1 file changed, 13 insertions(+)

diff --git a/man7/feature_test_macros.7 b/man7/feature_test_macros.7
index cdd962f7f..d33041001 100644
--- a/man7/feature_test_macros.7
+++ b/man7/feature_test_macros.7
@@ -412,6 +412,15 @@ 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

Please use semantic newlines.  See man-pages(7):

   Use semantic newlines
       In the source of a manual page, new sentences  should  be
       started on new lines, long sentences should be split into
       lines  at  clause breaks (commas, semicolons, colons, and
       so on), and long clauses should be split at phrase bound‐
       aries.  This convention,  sometimes  known  as  "semantic
       newlines",  makes it easier to see the effect of patches,
       which often operate at the level of individual sentences,
       clauses, or phrases.

That is: 's/2038. /2038.\n/'

+.B _FILE_OFFSET_BITS
+and depending on implementation, may require it set.

Am I understanding this right? _FILE_OFFSET_BITS is required to be set for _TIME_BITS to be also set (in some archs)? Could you please link directly to a source for that in the commit log? They are somewhat related, but I'm quite surprised that something to do with file sizes interferes at all with something to do with time.

Thanks,

Alex

+.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 +863,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: OpenPGP_signature
Description: OpenPGP digital signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux