Re: [PATCH] Fix the man page

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

 



Hi Alejandro,
  Sorry for the late reply! Thank you for your help! Yes, all comments
are very clear, understandable and helpful! This is the new patch.
Thank you for reviewing! Also, thank Elliott for helping! Hope this
patch is qualified!
Best,
Zijun


On Sat, Jul 15, 2023 at 9:13 AM Alejandro Colomar <alx@xxxxxxxxxx> wrote:
>
> Hi Zijun,
>
> On 2023-07-12 01:48, Zijun Zhao wrote:
> > Hi Alejandro,
> >   Sorry for the late reply!
>
> No problem :-)
>
> > I made some changes(make the subject more
> > formal, add a blank line, respect the80-column right margin and use -u
> > to when doing git format-patch) and attached the patch below.
>
> Thanks!
>
> > But I am
> > a bit confused about semantic newlines. I think I already start on a
> > new line and use clause breaks to split long sentences? Do I
> > misunderstand something? Thank you!
>
> Here's your patch, modified to use semantic newlines:
>
> +The kernel accepts null for both time and timezone.
> +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.
>
> Does it make sense now?
>
> I'll also comment a few things about the patch:
>
> > +The kernel accepts null for both time and timezone.
>
> We should use the 'tv' and 'tz' identifiers.  We should also use NULL.
> I suggest:
>
> 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,
>
> Could you give an example of why bionic differs from glibc and musl,
> and why it can be useful.  It is mostly curiosity, but it might be
> useful to have it documented in the commit message.
>
> > +but Android does not update the kernel timezone
> > +based on the device timezone in Settings,
> > +so the kernel's timezone is typically UTC.
>
> Cheers,
> Alex
>
> --
> <http://www.alejandro-colomar.es/>
> GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
>
From 5390023512c4a8a2c79cca7946944c4e3677d3c0 Mon Sep 17 00:00:00 2001
From: Zijun Zhao <zijunzhao@google.com>
Date: Mon, 5 Jun 2023 11:45:49 -0700
Subject: [PATCH] gettimeofday.2: Add some details about the nullability of
 argument tv in different libraries.

We find tv arg is allowed to be null in bionic so make the documentation more clear.
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.
---
 man2/gettimeofday.2 | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/man2/gettimeofday.2 b/man2/gettimeofday.2
index 9d134fa49..a75e6608c 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 ()
-- 
2.41.0.585.gd2178a4bd4-goog


[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