diff options
author | Zijun Zhao <zijunzhao@google.com> | 2023-06-05 11:45:49 -0700 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2023-07-28 22:36:40 +0200 |
commit | eacc876c76a3e4bf6f3b033ed072701d7c27e575 (patch) | |
tree | f86b7fe3aa73abd92d05187c68a1fbbec35b2a93 | |
parent | ec32926e9b5aa37c4c40fc8c09497cf2a50560a7 (diff) |
gettimeofday.2: Add details about the nullability of tv in different libc's
tv arg is allowed to be NULL in bionic.
POSIX says this behavior is undefined, and bionic just exposes the Linux
syscall directly. There's no code in bionic for
gettimeofday/settimeofday; just a description of the syscall name and
arguments from which an assembler stub is automatically generated at
build time. musl and glibc go out of their way to behave differently
from the Linux kernel, but no idea why.
Signed-off-by: Zijun Zhao <zijunzhao@google.com>
Cc: Elliott Hughes <enh@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r-- | man2/gettimeofday.2 | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/man2/gettimeofday.2 b/man2/gettimeofday.2 index 9d134fa49..7c2892315 100644 --- a/man2/gettimeofday.2 +++ b/man2/gettimeofday.2 @@ -175,6 +175,17 @@ On some architectures, an implementation of .BR gettimeofday () is provided in the .BR vdso (7). +.PP +The kernel accepts NULL for both +.I tv +and +.IR tz. +The timezone argument is ignored by glibc and musl, +and not passed to/from the kernel. +Android's bionic passes the timezone argument to/from the kernel, +but Android does not update the kernel timezone +based on the device timezone in Settings, +so the kernel's timezone is typically UTC. .SH STANDARDS .TP .BR gettimeofday () |