summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-12-28 12:03:37 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2021-12-28 12:04:49 -0800
commitd45d16182d90c871b59582b4628b6e0e5f5a9ead (patch)
treec1240e28bc495c24cebad1be14c1d96c3b001795 /doc
parentaf4148ce0197502ce017418871da592bd7be5d91 (diff)
downloadgnulib-d45d16182d90c871b59582b4628b6e0e5f5a9ead.tar.gz
clock_getres: document portability issues better
* doc/posix-functions/clock_getres.texi: * doc/posix-functions/timespec_getres.texi: Document problems with timestamp resolution.
Diffstat (limited to 'doc')
-rw-r--r--doc/posix-functions/clock_getres.texi11
-rw-r--r--doc/posix-functions/timespec_getres.texi8
2 files changed, 18 insertions, 1 deletions
diff --git a/doc/posix-functions/clock_getres.texi b/doc/posix-functions/clock_getres.texi
index 1381c4649c..e93e8b30f5 100644
--- a/doc/posix-functions/clock_getres.texi
+++ b/doc/posix-functions/clock_getres.texi
@@ -15,7 +15,16 @@ Portability problems not fixed by Gnulib:
@item
This function is missing on some platforms:
Mac OS X 10.11, Minix 3.1.8, mingw, MSVC 14.
+
+@item
+On many platforms, this function returns a value other than the clock
+resolution of @code{clock_gettime}, i.e., the minimum distance between
+differing timestamps. For example, on AIX 7.2 it returns 10
+milliseconds even though the clock resolution is 1 microsecond.
+Conversely, on GNU/Linux it typically returns 1 nanosecond even
+though the clock resolution may be greater.
@end itemize
The Gnulib module @code{gettime-res} is a partial substitute; it implements
-the @code{CLOCK_REALTIME} functionality of @code{clock_getres}.
+the @code{CLOCK_REALTIME} functionality of @code{clock_getres},
+and fixes the too-high resolution bug of platforms like AIX 7.2.
diff --git a/doc/posix-functions/timespec_getres.texi b/doc/posix-functions/timespec_getres.texi
index 89d3e6f16f..c18a3635ff 100644
--- a/doc/posix-functions/timespec_getres.texi
+++ b/doc/posix-functions/timespec_getres.texi
@@ -15,4 +15,12 @@ glibc 2.33, macOS 12, FreeBSD 13.0, NetBSD 9.2, OpenBSD 7.0, Minix 3.3.0, AIX 7.
Portability problems not fixed by Gnulib:
@itemize
+@item
+On some platforms, this function returns a value other than the clock
+resolution of @code{timespec_get}, i.e., the minimum distance between
+differing timestamps. For example, on GNU/Linux it typically returns
+1 nanosecond regardless of the actual clock resolution.
@end itemize
+
+The Gnulib module @code{gettime-res} is a partial substitute; it implements
+the @code{TIME_UTC} functionality of @code{timespec_getres}.