On 1/3/20 5:21 AM, Bruno Haible wrote:
I'm therefore adding this doc update in gnulib. Does it sound correct?
Looks OK, thanks.
There's also the problem with filesystems with 64-bit timestamps on
platforms with 32-bit time_t. I installed the attached to mention this
issue.
>From 32ad2568ca756089414b931028fde202770d02d3 Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Fri, 3 Jan 2020 11:45:19 -0800
Subject: [PATCH] doc: mention 32-bit time_t issue
* doc/posix-headers/sys_stat.texi (sys/stat.h):
* doc/posix-headers/time.texi (time.h): Mention 2038.
---
ChangeLog | 6 ++++++
doc/posix-headers/sys_stat.texi | 3 +++
doc/posix-headers/time.texi | 9 ++++++++-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index c18a95adf..6c0d92504 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-01-03 Paul Eggert <egg...@cs.ucla.edu>
+
+ doc: mention 32-bit time_t issue
+ * doc/posix-headers/sys_stat.texi (sys/stat.h):
+ * doc/posix-headers/time.texi (time.h): Mention 2038.
+
2020-01-03 Bruno Haible <br...@clisp.org>
mbrtowc: Ensure the mbtowc_lock is unique.
diff --git a/doc/posix-headers/sys_stat.texi b/doc/posix-headers/sys_stat.texi
index 55a23e4b2..78b423097 100644
--- a/doc/posix-headers/sys_stat.texi
+++ b/doc/posix-headers/sys_stat.texi
@@ -40,6 +40,9 @@ On Windows platforms (excluding Cygwin), @code{st_ino} is always 0.
Portability problems not fixed by Gnulib:
@itemize
@item
+@xref{time.h}, for general portability problems with the
+@code{time_t} components of @code{struct stat}.
+@item
The macro @code{S_IFBLK} is missing on some platforms:
MSVC 14.
@item
diff --git a/doc/posix-headers/time.texi b/doc/posix-headers/time.texi
index ef840fe38..67741ca56 100644
--- a/doc/posix-headers/time.texi
+++ b/doc/posix-headers/time.texi
@@ -19,8 +19,15 @@ NetBSD 5.0
Portability problems not fixed by Gnulib:
@itemize
@item
+On platforms with 32-bit @code{time_t}, functions like @code{stat} can
+fail with @code{errno == EOVERFLOW} when a timestamp is out of range,
+such as with a file timestamp in the far future or past; on others,
+the functions silently return the low-order 32 bits of the correct
+timestamp. These platforms will be obsolete when 32-bit @code{time_t}
+rolls around, which will occur the year 2038 for the typical case when
+@code{time_t} is signed.
+@item
On some platforms the @code{tv_nsec} member of @code{struct timespec}
is not of type @code{long}, but is of type @code{long long} instead:
glibc x32
-
@end itemize
--
2.24.1