All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][COVER LETTER] tzset.3: correct file paths and TZ use
@ 2015-01-18  0:30 JWP
       [not found] ` <54BAFE98.2090402-KK0ffGbhmjU@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: JWP @ 2015-01-18  0:30 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

Hello Everyone,

This is my first contribution to the linux-man
project and I do not know what level of proof is
required for changes, so I'll try to be brief.

tzset.3 says that /usr/share/zoneinfo/localtime
is used for the system timezone if TZ is not set.

glibc does not use this file, and its Makeconfig
comments discourages the use of it at all:

# Where to install default configuration files.  These include the local
# timezone specification and network data base files.
ifndef sysconfdir
sysconfdir = $(prefix)/etc
endif
inst_sysconfdir = $(install_root)$(sysconfdir)

# Where to install the "localtime" timezone file; this is the file whose
# contents $(localtime) specifies.  If this is a relative pathname, it is
# relative to $(zonedir).  It is a good idea to put this somewhere
# other than there, so the zoneinfo directory contains only universal data,
# localizing the configuration data elsewhere.
ifndef localtime-file
localtime-file = $(sysconfdir)/localtime
endif

As shown above the localtime file is in etc/

Further, the manual says if the TZ filespec is
omitted it will use /usr/share/zoneinfo/localtime,
but glibc actually will use UTC in that case,
which the manual states in the third paragraph of
the DESCRIPTION section.

I made some other minor changes that I hopefully
do not need to justify.

Thank you

J William Piggott (1):
  tzset.3: correct file paths and TZ use

 man3/tzset.3 | 81 +++++++++++++++++++++++++++---------------------------------
 1 file changed, 37 insertions(+), 44 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] tzset.3: correct file paths and TZ use
       [not found] ` <54BAFE98.2090402-KK0ffGbhmjU@public.gmane.org>
@ 2015-01-18  0:34   ` JWP
       [not found]     ` <54BAFFAE.2020106-KK0ffGbhmjU@public.gmane.org>
  2015-01-18 20:00   ` [PATCH[V2] 1/5] tzset.3: filespec omitted incorrect JWP
                     ` (4 subsequent siblings)
  5 siblings, 1 reply; 24+ messages in thread
From: JWP @ 2015-01-18  0:34 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

Remove references to /usr/share/zoneinfo/{localtime,posixrules}
as they are not used.

Add information on invalid TZ values.
Add information on a TZ filespec that omits the colon.
Add information on system timezone configuration.
Add an ENVIRONMENT section.
Update the FILES section.

Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
---

The following changes since commit dc70d1eaef1643ae48a9b67fcde0cd0b59bf1f20:

  ld.so.8: tfix (2015-01-16 15:07:43 +0100)

are available in the git repository at:

  git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:jwpi/man-pages.git tzset

for you to fetch changes up to 13f95862d88f041ce652ff846b2706c3d1fccf6a:

  tzset.3: correct file paths and TZ use (2015-01-17 16:51:42 -0500)


 man3/tzset.3 | 81 +++++++++++++++++++++++++++---------------------------------
 1 file changed, 37 insertions(+), 44 deletions(-)

diff --git a/man3/tzset.3 b/man3/tzset.3
index c1c98e1..1058d2c 100644
--- a/man3/tzset.3
+++ b/man3/tzset.3
@@ -30,7 +30,7 @@
 .\" Modified 2001-11-13, aeb
 .\" Modified 2004-12-01 mtk and Martin Schulze <joey-1lCxjdRlhQ9g9hUCZPvPmw@public.gmane.org>
 .\"
-.TH TZSET 3  2014-08-19 "" "Linux Programmer's Manual"
+.TH TZSET 3  2015-01-16 "" "Linux Programmer's Manual"
 .SH NAME
 tzset, tzname, timezone, daylight \- initialize time conversion information
 .SH SYNOPSIS
@@ -75,15 +75,14 @@ the year when daylight saving time applies).
 .PP
 If the
 .B TZ
-variable does not appear in the environment, the \fItzname\fP
-variable is initialized with the best approximation of local wall clock
-time, as specified by the
-.BR tzfile (5)-format
-file \fIlocaltime\fP
-found in the system timezone directory (see below).
-(One also often sees
-.I /etc/localtime
-used here, a symlink to the right file in the system timezone directory.)
+variable does not appear in the environment, the system timezone is used.
+The system timezone is configured by copying, or linking, a file in the
+.BR tzfile "(5) format to"
+.IR /etc/localtime .
+A timezone database of these files may be located in the system
+timezone directory (see the \fBFILES\fP section below).
+
+
 .PP
 If the
 .B TZ
@@ -118,7 +117,7 @@ The second format is used when there is daylight saving time:
 .I std offset dst [offset],start[/time],end[/time]
 .RE
 .sp
-There are no spaces in the specification.
+There are no spaces in either specification.
 The initial \fIstd\fP and
 \fIoffset\fP specify the standard timezone, as described above.
 The \fIdst\fP string and \fIoffset\fP specify the name and offset for the
@@ -170,47 +169,41 @@ from a file:
 :[filespec]
 .RE
 .sp
-If the file specification \fIfilespec\fP is omitted, the timezone
-information is read from the file
-.I localtime
-in the system timezone directory, which nowadays usually is
-.IR /usr/share/zoneinfo .
-This file is in
+If the file specification \fIfilespec\fP is omitted, or its value cannot
+be interpreted, Coordinated Universal Time (UTC) is used.  A correct
+\%\fIfilespec\fP will be a path pointing to a file in the
 .BR tzfile (5)
-format.
-If \fIfilespec\fP is given, it specifies another
-.BR tzfile (5)-format
-file to read the timezone information from.
-If \fIfilespec\fP does not begin with a \(aq/\(aq, the file specification is
-relative to the system timezone directory.
+format. A timezone database of these files may be located in the system
+timezone directory (see the \fBFILES\fP section below).  If
+\fIfilespec\fP does not begin with a \(aq/\(aq, the file specification
+is relative to the system timezone directory. If the colon is omitted
+each of the above three \fBTZ\fP formats will be tried in order.
 .PP
 Here's an example, once more for New Zealand:
 .nf
 
     TZ=":Pacific/Auckland"
 .fi
+.SH ENVIRONMENT
+.TP
+.B TZ
+.RB If \ TZ
+is set, its value takes precedence over the system configured timezone.
+.TP
+.B TZDIR
+.RB If \ TZDIR
+is set, its value takes precedence over the system configured timezone
+database directory path.
 .SH FILES
-Under glibc,
-the system timezone directory is determined using the
-.BR TZDIR
-the environment variable.
-If
-.BR TZDIR
-is not set, the default depends on the system setup, but is normally
-.IR /usr/share/zoneinfo .
-.LP
-This timezone directory contains the files

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH] tzset.3: correct file paths and TZ use
       [not found]     ` <54BAFFAE.2020106-KK0ffGbhmjU@public.gmane.org>
@ 2015-01-18 11:02       ` Michael Kerrisk (man-pages)
       [not found]         ` <54BB92AE.4090604-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Michael Kerrisk (man-pages) @ 2015-01-18 11:02 UTC (permalink / raw)
  To: JWP; +Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA

Hello William,

On 01/18/2015 01:34 AM, JWP wrote:
> Remove references to /usr/share/zoneinfo/{localtime,posixrules}
> as they are not used.
> 
> Add information on invalid TZ values.
> Add information on a TZ filespec that omits the colon.
> Add information on system timezone configuration.
> Add an ENVIRONMENT section.
> Update the FILES section.

Thanks for submitting this, but it's very hard for me to use
this patch in the submitted form. Specifically:

* It groups a number of unrelated changes into a single patch.
  Could you break each logical change into a separate commit/patch
  please. This would allow me (and others) to independently review
  each piece and decide whether it should be applied.

* Please make the patch descriptions more than just a statement of
  *what* you changed. Please explain what the problem was, and why 
  you fixed it as you did, and where it makes sense add pointers 
  to information that supports you reasoning.

Thanks,

Michael


> Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
> ---
> 
> The following changes since commit dc70d1eaef1643ae48a9b67fcde0cd0b59bf1f20:
> 
>   ld.so.8: tfix (2015-01-16 15:07:43 +0100)
> 
> are available in the git repository at:
> 
>   git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:jwpi/man-pages.git tzset
> 
> for you to fetch changes up to 13f95862d88f041ce652ff846b2706c3d1fccf6a:
> 
>   tzset.3: correct file paths and TZ use (2015-01-17 16:51:42 -0500)
> 
> 
>  man3/tzset.3 | 81 +++++++++++++++++++++++++++---------------------------------
>  1 file changed, 37 insertions(+), 44 deletions(-)
> 
> diff --git a/man3/tzset.3 b/man3/tzset.3
> index c1c98e1..1058d2c 100644
> --- a/man3/tzset.3
> +++ b/man3/tzset.3
> @@ -30,7 +30,7 @@
>  .\" Modified 2001-11-13, aeb
>  .\" Modified 2004-12-01 mtk and Martin Schulze <joey-1lCxjdRlhQ9g9hUCZPvPmw@public.gmane.org>
>  .\"
> -.TH TZSET 3  2014-08-19 "" "Linux Programmer's Manual"
> +.TH TZSET 3  2015-01-16 "" "Linux Programmer's Manual"
>  .SH NAME
>  tzset, tzname, timezone, daylight \- initialize time conversion information
>  .SH SYNOPSIS
> @@ -75,15 +75,14 @@ the year when daylight saving time applies).
>  .PP
>  If the
>  .B TZ
> -variable does not appear in the environment, the \fItzname\fP
> -variable is initialized with the best approximation of local wall clock
> -time, as specified by the
> -.BR tzfile (5)-format
> -file \fIlocaltime\fP
> -found in the system timezone directory (see below).
> -(One also often sees
> -.I /etc/localtime
> -used here, a symlink to the right file in the system timezone directory.)
> +variable does not appear in the environment, the system timezone is used.
> +The system timezone is configured by copying, or linking, a file in the
> +.BR tzfile "(5) format to"
> +.IR /etc/localtime .
> +A timezone database of these files may be located in the system
> +timezone directory (see the \fBFILES\fP section below).
> +
> +
>  .PP
>  If the
>  .B TZ
> @@ -118,7 +117,7 @@ The second format is used when there is daylight saving time:
>  .I std offset dst [offset],start[/time],end[/time]
>  .RE
>  .sp
> -There are no spaces in the specification.
> +There are no spaces in either specification.
>  The initial \fIstd\fP and
>  \fIoffset\fP specify the standard timezone, as described above.
>  The \fIdst\fP string and \fIoffset\fP specify the name and offset for the
> @@ -170,47 +169,41 @@ from a file:
>  :[filespec]
>  .RE
>  .sp
> -If the file specification \fIfilespec\fP is omitted, the timezone
> -information is read from the file
> -.I localtime
> -in the system timezone directory, which nowadays usually is
> -.IR /usr/share/zoneinfo .
> -This file is in
> +If the file specification \fIfilespec\fP is omitted, or its value cannot
> +be interpreted, Coordinated Universal Time (UTC) is used.  A correct
> +\%\fIfilespec\fP will be a path pointing to a file in the
>  .BR tzfile (5)
> -format.
> -If \fIfilespec\fP is given, it specifies another
> -.BR tzfile (5)-format
> -file to read the timezone information from.
> -If \fIfilespec\fP does not begin with a \(aq/\(aq, the file specification is
> -relative to the system timezone directory.
> +format. A timezone database of these files may be located in the system
> +timezone directory (see the \fBFILES\fP section below).  If
> +\fIfilespec\fP does not begin with a \(aq/\(aq, the file specification
> +is relative to the system timezone directory. If the colon is omitted
> +each of the above three \fBTZ\fP formats will be tried in order.
>  .PP
>  Here's an example, once more for New Zealand:
>  .nf
>  
>      TZ=":Pacific/Auckland"
>  .fi
> +.SH ENVIRONMENT
> +.TP
> +.B TZ
> +.RB If \ TZ
> +is set, its value takes precedence over the system configured timezone.
> +.TP
> +.B TZDIR
> +.RB If \ TZDIR
> +is set, its value takes precedence over the system configured timezone
> +database directory path.
>  .SH FILES
> -Under glibc,
> -the system timezone directory is determined using the
> -.BR TZDIR
> -the environment variable.
> -If
> -.BR TZDIR
> -is not set, the default depends on the system setup, but is normally
> -.IR /usr/share/zoneinfo .
> -.LP
> -This timezone directory contains the files
> -
> -.nf
> -    localtime      local timezone file
> -    posixrules     rules for POSIX-style TZ's
> -.fi
> -.LP
> -Often,
> -.I /etc/localtime
> -is a symbolic link to the file
> -.I localtime
> -or to the correct timezone file in the system timezone directory.
> +.TP
> +.B /etc/localtime
> +The system timezone file.
> +.TP
> +.B /usr/share/zoneinfo/
> +The system timezone database directory.
> +.PP
> +Above are the current standard file locations, but they are
> +configurable when glibc is compiled.
>  .SH CONFORMING TO
>  SVr4, POSIX.1-2001, 4.3BSD.
>  .SH NOTES
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH[V2] 1/5] tzset.3: filespec omitted incorrect
       [not found] ` <54BAFE98.2090402-KK0ffGbhmjU@public.gmane.org>
  2015-01-18  0:34   ` [PATCH] " JWP
@ 2015-01-18 20:00   ` JWP
       [not found]     ` <54BC10C7.1030706-KK0ffGbhmjU@public.gmane.org>
  2015-01-18 20:02   ` [PATCH[V2] 2/5] tzset.3: First TZ specification clarification JWP
                     ` (3 subsequent siblings)
  5 siblings, 1 reply; 24+ messages in thread
From: JWP @ 2015-01-18 20:00 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

Paragraph three of the DESCRIPTION section says
that when TZ is set, but empty, then UTC is used.

Later it says if the TZ filespec is omitted then
the file /usr/share/zoneinfo/localtime is used.
This is incorrect, it will use UTC in that case as
well.

Steps to reproduce:

cd /usr/share/zoneinfo/
cp Antarctica/South_Pole localtime
cd
date
Sun Jan 18 10:59:50 EST 2015
TZ=:Hongkong date
Sun Jan 18 23:59:56 HKT 2015
TZ=:/usr/share/zoneinfo/localtime date
Mon Jan 19 05:00:03 NZDT 2015
TZ=: date
Sun Jan 18 16:00:11 UTC 2015
TZ=":" date
Sun Jan 18 16:00:18 UTC 2015
TZ=':' date
Sun Jan 18 16:00:24 UTC 2015
TZ=:/ date
Sun Jan 18 16:00:34  2015
TZ=":/" date
Sun Jan 18 16:00:40  2015
TZ="" date
Sun Jan 18 16:00:45 UTC 2015

Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
---

The following changes since commit b58839b96d626e67da233d4bf7ba04d5dfcd0e66:

  syscalls.2: Remove some details for sync_file_range2() (2015-01-18 19:56:05 +0100)

are available in the git repository at:

  git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:jwpi/man-pages.git tzset

for you to fetch changes up to 2b0725c0b6f6788628567ea4d5cfc396898584a0:

  tzset.3: TZ filespec omitts the colon (2015-01-18 14:40:21 -0500)


 man3/tzset.3 | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/man3/tzset.3 b/man3/tzset.3
index c1c98e1..36d2fd7 100644
--- a/man3/tzset.3
+++ b/man3/tzset.3
@@ -170,14 +170,8 @@ from a file:
 :[filespec]
 .RE
 .sp
-If the file specification \fIfilespec\fP is omitted, the timezone
-information is read from the file
-.I localtime
-in the system timezone directory, which nowadays usually is
-.IR /usr/share/zoneinfo .
-This file is in
-.BR tzfile (5)
-format.
+If the file specification \fIfilespec\fP is omitted, or its value cannot
+be interpreted, then Coordinated Universal Time (UTC) is used.
 If \fIfilespec\fP is given, it specifies another
 .BR tzfile (5)-format
 file to read the timezone information from.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH[V2] 2/5] tzset.3: First TZ specification clarification
       [not found] ` <54BAFE98.2090402-KK0ffGbhmjU@public.gmane.org>
  2015-01-18  0:34   ` [PATCH] " JWP
  2015-01-18 20:00   ` [PATCH[V2] 1/5] tzset.3: filespec omitted incorrect JWP
@ 2015-01-18 20:02   ` JWP
       [not found]     ` <54BC1172.5060100-KK0ffGbhmjU@public.gmane.org>
  2015-01-18 20:04   ` [PATCH[V2] 3/5] tzset.3: correct system timezone file path JWP
                     ` (2 subsequent siblings)
  5 siblings, 1 reply; 24+ messages in thread
From: JWP @ 2015-01-18 20:02 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

The second TZ specification states that no spaces
are allowed, this is true for the first
specification as well. The text of these two are
closely coupled so including the first
specification by using 'either' is sufficient.

Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
---

The following changes since commit b58839b96d626e67da233d4bf7ba04d5dfcd0e66:

  syscalls.2: Remove some details for sync_file_range2() (2015-01-18 19:56:05 +0100)

are available in the git repository at:

  git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:jwpi/man-pages.git tzset

for you to fetch changes up to 2b0725c0b6f6788628567ea4d5cfc396898584a0:

  tzset.3: TZ filespec omitts the colon (2015-01-18 14:40:21 -0500)


 man3/tzset.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man3/tzset.3 b/man3/tzset.3
index 36d2fd7..3f9b246 100644
--- a/man3/tzset.3
+++ b/man3/tzset.3
@@ -118,7 +118,7 @@ The second format is used when there is daylight saving time:
 .I std offset dst [offset],start[/time],end[/time]
 .RE
 .sp
-There are no spaces in the specification.
+There are no spaces in either specification.
 The initial \fIstd\fP and
 \fIoffset\fP specify the standard timezone, as described above.
 The \fIdst\fP string and \fIoffset\fP specify the name and offset for the
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH[V2] 3/5] tzset.3: correct system timezone file path
       [not found] ` <54BAFE98.2090402-KK0ffGbhmjU@public.gmane.org>
                     ` (2 preceding siblings ...)
  2015-01-18 20:02   ` [PATCH[V2] 2/5] tzset.3: First TZ specification clarification JWP
@ 2015-01-18 20:04   ` JWP
       [not found]     ` <54BC11E2.9020906-KK0ffGbhmjU@public.gmane.org>
  2015-01-18 20:07   ` [PATCH[V2] 4/5] tzset.3: Add Environment section JWP
  2015-01-18 20:10   ` [PATCH[V2] 5/5] tzset.3: TZ filespec omitts the colon JWP
  5 siblings, 1 reply; 24+ messages in thread
From: JWP @ 2015-01-18 20:04 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

The manual incorrectly states the system timezone
path as /usr/share/zoneinfo/localtime. Glibc does
not use that file for anything, it uses
$(prefix)/etc/localtime.

There is an ambiguous reference in the man-page to
/etc/localtime, but it does not indicate that it
will be used. It states clearly that
/usr/share/zoneinfo/localtime is used.

A comment in the glibc Makeconfig even says that
file should not exist:

> ... relative to $(zonedir).  It is a good idea
> to put this somewhere other than there, so the
> zoneinfo directory contains only universal data,
> localizing the configuration data elsewhere.

Furthermore, the man-page does not indicate the
reason this file is being used; which is because
it is the configured system timezone.

A later patch in this series address the
possibility that /etc/localtime could be changed
during glibc's compilation. The language changed
in this patch points to the FILE section which is
where the explanation will be. There is no reason
to repeat that information multiple times
throughout the man-page.

EVIDENCE:

glibc/Makeconfig:256: sysconfdir = $(prefix)/etc
glibc/Makeconfig:272: localtime-file = $(sysconfdir)/localtime

FROM INFO LIBC:
C.2 Installing the C Library
============================
   To configure the locally used timezone, set the `TZ' environment
variable.  The script `tzselect' helps you to select the right value.
As an example, for Germany, `tzselect' would tell you to use
`TZ='Europe/Berlin''.  For a system wide installation (the given paths
are for an installation with `--prefix=/usr'), link the timezone file
which is in `/usr/share/zoneinfo' to the file `/etc/localtime'.  For
Germany, you might execute `ln -s /usr/share/zoneinfo/Europe/Berlin
/etc/localtime'.

STEPS TO REPRODUCE:

cd /usr/share/zoneinfo/
cp Antarctica/South_Pole localtime
cp /US/Eastern /etc/localtime
cd
date
Sun Jan 18 12:06:36 EST 2015
TZ=:/usr/share/zoneinfo/localtime date
Mon Jan 19 06:06:54 NZDT 2015
rm /etc/localtime
date
Sun Jan 18 17:08:37 UTC 2015
TZ=:/usr/share/zoneinfo/localtime date
Mon Jan 19 06:08:41 NZDT 2015

Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
---

The following changes since commit b58839b96d626e67da233d4bf7ba04d5dfcd0e66:

  syscalls.2: Remove some details for sync_file_range2() (2015-01-18 19:56:05 +0100)

are available in the git repository at:

  git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:jwpi/man-pages.git tzset

for you to fetch changes up to 2b0725c0b6f6788628567ea4d5cfc396898584a0:

  tzset.3: TZ filespec omitts the colon (2015-01-18 14:40:21 -0500)


 man3/tzset.3 | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/man3/tzset.3 b/man3/tzset.3
index 3f9b246..09fac15 100644
--- a/man3/tzset.3
+++ b/man3/tzset.3
@@ -75,15 +75,12 @@ the year when daylight saving time applies).
 .PP
 If the
 .B TZ
-variable does not appear in the environment, the \fItzname\fP
-variable is initialized with the best approximation of local wall clock
-time, as specified by the
-.BR tzfile (5)-format
-file \fIlocaltime\fP
-found in the system timezone directory (see below).
-(One also often sees
-.I /etc/localtime
-used here, a symlink to the right file in the system timezone directory.)
+variable does not appear in the environment, the system timezone is used.
+The system timezone is configured by copying, or linking, a file in the
+.BR tzfile "(5) format to"
+.IR /etc/localtime .
+A timezone database of these files may be located in the system
+timezone directory (see the \fBFILES\fP section below).
 .PP
 If the
 .B TZ
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH[V2] 4/5] tzset.3: Add Environment section
       [not found] ` <54BAFE98.2090402-KK0ffGbhmjU@public.gmane.org>
                     ` (3 preceding siblings ...)
  2015-01-18 20:04   ` [PATCH[V2] 3/5] tzset.3: correct system timezone file path JWP
@ 2015-01-18 20:07   ` JWP
       [not found]     ` <54BC126E.1080904-KK0ffGbhmjU@public.gmane.org>
  2015-01-18 20:10   ` [PATCH[V2] 5/5] tzset.3: TZ filespec omitts the colon JWP
  5 siblings, 1 reply; 24+ messages in thread
From: JWP @ 2015-01-18 20:07 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

FILES section was overly verbose and included
environment variables.  Added ENVIRONMENT section,
removing ENV VARS from the FILES section.
Corrected Files section items.

As stated in the previous commit
/usr/share/zoneinfo/localtime
is not used, nor recommended by glibc.

Also not used is:
/usr/share/zoneinfo/posixrules

STEPS TO REPRODUCE NO posixrules:

TZ=EST+5EDT,M1.3.0/2,M10.5.0/2 date
Sun Jan 18 14:01:24 EDT 2015
TZ=EST+5EDT,M1.4.0/2,M10.5.0/2 date
Sun Jan 18 13:01:27 EST 2015

Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
---

The following changes since commit b58839b96d626e67da233d4bf7ba04d5dfcd0e66:

  syscalls.2: Remove some details for sync_file_range2() (2015-01-18 19:56:05 +0100)

are available in the git repository at:

  git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:jwpi/man-pages.git tzset

for you to fetch changes up to 2b0725c0b6f6788628567ea4d5cfc396898584a0:

  tzset.3: TZ filespec omitts the colon (2015-01-18 14:40:21 -0500)


 man3/tzset.3 | 40 +++++++++++++++++++---------------------
 1 file changed, 19 insertions(+), 21 deletions(-)

diff --git a/man3/tzset.3 b/man3/tzset.3
index 09fac15..b49c8ee 100644
--- a/man3/tzset.3
+++ b/man3/tzset.3
@@ -180,28 +180,26 @@ Here's an example, once more for New Zealand:
 
     TZ=":Pacific/Auckland"
 .fi
+.SH ENVIRONMENT
+.TP
+.B TZ
+.RB If \ TZ
+is set, its value takes precedence over the system configured timezone.
+.TP
+.B TZDIR
+.RB If \ TZDIR
+is set, its value takes precedence over the system configured timezone
+database directory path.
 .SH FILES
-Under glibc,
-the system timezone directory is determined using the
-.BR TZDIR
-the environment variable.
-If
-.BR TZDIR
-is not set, the default depends on the system setup, but is normally
-.IR /usr/share/zoneinfo .
-.LP
-This timezone directory contains the files

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH[V2] 5/5] tzset.3: TZ filespec omitts the colon
       [not found] ` <54BAFE98.2090402-KK0ffGbhmjU@public.gmane.org>
                     ` (4 preceding siblings ...)
  2015-01-18 20:07   ` [PATCH[V2] 4/5] tzset.3: Add Environment section JWP
@ 2015-01-18 20:10   ` JWP
       [not found]     ` <54BC132A.8090504-KK0ffGbhmjU@public.gmane.org>
  5 siblings, 1 reply; 24+ messages in thread
From: JWP @ 2015-01-18 20:10 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

If the TZ filespec omits the leading colon, glibc
will parse it for any valid format, i.e., it will
still work.

STEPS TO REPRODUCE:
TZ=:Europe/Kiev date
Sun Jan 18 20:19:13 EET 2015
TZ=Europe/Kiev date
Sun Jan 18 20:19:20 EET 2015

Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
---

The following changes since commit b58839b96d626e67da233d4bf7ba04d5dfcd0e66:

  syscalls.2: Remove some details for sync_file_range2() (2015-01-18 19:56:05 +0100)

are available in the git repository at:

  git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:jwpi/man-pages.git tzset

for you to fetch changes up to 2b0725c0b6f6788628567ea4d5cfc396898584a0:

  tzset.3: TZ filespec omitts the colon (2015-01-18 14:40:21 -0500)


 man3/tzset.3 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/man3/tzset.3 b/man3/tzset.3
index b49c8ee..5c721b6 100644
--- a/man3/tzset.3
+++ b/man3/tzset.3
@@ -173,7 +173,8 @@ If \fIfilespec\fP is given, it specifies another
 .BR tzfile (5)-format
 file to read the timezone information from.
 If \fIfilespec\fP does not begin with a \(aq/\(aq, the file specification is
-relative to the system timezone directory.
+relative to the system timezone directory.  If the colon is omitted each
+of the above three \fBTZ\fP formats will be tried in order.
 .PP
 Here's an example, once more for New Zealand:
 .nf
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH] tzset.3: correct file paths and TZ use
       [not found]         ` <54BB92AE.4090604-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-01-23 17:29           ` JWP
       [not found]             ` <54C28516.7070802-KK0ffGbhmjU@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: JWP @ 2015-01-23 17:29 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

Hello Michael,

I split the patch[V2] and added more details as requested.
Is there still something wrong with my submission?

Thank you 
Have a great weekend

On 01/18/2015 06:02 AM, Michael Kerrisk (man-pages) wrote:
> Hello William,
> 
> On 01/18/2015 01:34 AM, JWP wrote:
>> Remove references to /usr/share/zoneinfo/{localtime,posixrules}
>> as they are not used.
>>
>> Add information on invalid TZ values.
>> Add information on a TZ filespec that omits the colon.
>> Add information on system timezone configuration.
>> Add an ENVIRONMENT section.
>> Update the FILES section.
> 
> Thanks for submitting this, but it's very hard for me to use
> this patch in the submitted form. Specifically:
> 
> * It groups a number of unrelated changes into a single patch.
>   Could you break each logical change into a separate commit/patch
>   please. This would allow me (and others) to independently review
>   each piece and decide whether it should be applied.
> 
> * Please make the patch descriptions more than just a statement of
>   *what* you changed. Please explain what the problem was, and why 
>   you fixed it as you did, and where it makes sense add pointers 
>   to information that supports you reasoning.
> 
> Thanks,
> 
> Michael
> 
> 
>> Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
>> ---
>>
>> The following changes since commit dc70d1eaef1643ae48a9b67fcde0cd0b59bf1f20:
>>
>>   ld.so.8: tfix (2015-01-16 15:07:43 +0100)
>>
>> are available in the git repository at:
>>
>>   git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:jwpi/man-pages.git tzset
>>
>> for you to fetch changes up to 13f95862d88f041ce652ff846b2706c3d1fccf6a:
>>
>>   tzset.3: correct file paths and TZ use (2015-01-17 16:51:42 -0500)
>>
>>
>>  man3/tzset.3 | 81 +++++++++++++++++++++++++++---------------------------------
>>  1 file changed, 37 insertions(+), 44 deletions(-)
>>
>> diff --git a/man3/tzset.3 b/man3/tzset.3
>> index c1c98e1..1058d2c 100644
>> --- a/man3/tzset.3
>> +++ b/man3/tzset.3
>> @@ -30,7 +30,7 @@
>>  .\" Modified 2001-11-13, aeb
>>  .\" Modified 2004-12-01 mtk and Martin Schulze <joey-1lCxjdRlhQ9g9hUCZPvPmw@public.gmane.org>
>>  .\"
>> -.TH TZSET 3  2014-08-19 "" "Linux Programmer's Manual"
>> +.TH TZSET 3  2015-01-16 "" "Linux Programmer's Manual"
>>  .SH NAME
>>  tzset, tzname, timezone, daylight \- initialize time conversion information
>>  .SH SYNOPSIS
>> @@ -75,15 +75,14 @@ the year when daylight saving time applies).
>>  .PP
>>  If the
>>  .B TZ
>> -variable does not appear in the environment, the \fItzname\fP
>> -variable is initialized with the best approximation of local wall clock
>> -time, as specified by the
>> -.BR tzfile (5)-format
>> -file \fIlocaltime\fP
>> -found in the system timezone directory (see below).
>> -(One also often sees
>> -.I /etc/localtime
>> -used here, a symlink to the right file in the system timezone directory.)
>> +variable does not appear in the environment, the system timezone is used.
>> +The system timezone is configured by copying, or linking, a file in the
>> +.BR tzfile "(5) format to"
>> +.IR /etc/localtime .
>> +A timezone database of these files may be located in the system
>> +timezone directory (see the \fBFILES\fP section below).
>> +
>> +
>>  .PP
>>  If the
>>  .B TZ
>> @@ -118,7 +117,7 @@ The second format is used when there is daylight saving time:
>>  .I std offset dst [offset],start[/time],end[/time]
>>  .RE
>>  .sp
>> -There are no spaces in the specification.
>> +There are no spaces in either specification.
>>  The initial \fIstd\fP and
>>  \fIoffset\fP specify the standard timezone, as described above.
>>  The \fIdst\fP string and \fIoffset\fP specify the name and offset for the
>> @@ -170,47 +169,41 @@ from a file:
>>  :[filespec]
>>  .RE
>>  .sp
>> -If the file specification \fIfilespec\fP is omitted, the timezone
>> -information is read from the file
>> -.I localtime
>> -in the system timezone directory, which nowadays usually is
>> -.IR /usr/share/zoneinfo .
>> -This file is in
>> +If the file specification \fIfilespec\fP is omitted, or its value cannot
>> +be interpreted, Coordinated Universal Time (UTC) is used.  A correct
>> +\%\fIfilespec\fP will be a path pointing to a file in the
>>  .BR tzfile (5)
>> -format.
>> -If \fIfilespec\fP is given, it specifies another
>> -.BR tzfile (5)-format
>> -file to read the timezone information from.
>> -If \fIfilespec\fP does not begin with a \(aq/\(aq, the file specification is
>> -relative to the system timezone directory.
>> +format. A timezone database of these files may be located in the system
>> +timezone directory (see the \fBFILES\fP section below).  If
>> +\fIfilespec\fP does not begin with a \(aq/\(aq, the file specification
>> +is relative to the system timezone directory. If the colon is omitted
>> +each of the above three \fBTZ\fP formats will be tried in order.
>>  .PP
>>  Here's an example, once more for New Zealand:
>>  .nf
>>  
>>      TZ=":Pacific/Auckland"
>>  .fi
>> +.SH ENVIRONMENT
>> +.TP
>> +.B TZ
>> +.RB If \ TZ
>> +is set, its value takes precedence over the system configured timezone.
>> +.TP
>> +.B TZDIR
>> +.RB If \ TZDIR
>> +is set, its value takes precedence over the system configured timezone
>> +database directory path.
>>  .SH FILES
>> -Under glibc,
>> -the system timezone directory is determined using the
>> -.BR TZDIR
>> -the environment variable.
>> -If
>> -.BR TZDIR
>> -is not set, the default depends on the system setup, but is normally
>> -.IR /usr/share/zoneinfo .
>> -.LP
>> -This timezone directory contains the files
>> -
>> -.nf
>> -    localtime      local timezone file
>> -    posixrules     rules for POSIX-style TZ's
>> -.fi
>> -.LP
>> -Often,
>> -.I /etc/localtime
>> -is a symbolic link to the file
>> -.I localtime
>> -or to the correct timezone file in the system timezone directory.
>> +.TP
>> +.B /etc/localtime
>> +The system timezone file.
>> +.TP
>> +.B /usr/share/zoneinfo/
>> +The system timezone database directory.
>> +.PP
>> +Above are the current standard file locations, but they are
>> +configurable when glibc is compiled.
>>  .SH CONFORMING TO
>>  SVr4, POSIX.1-2001, 4.3BSD.
>>  .SH NOTES
>>
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] tzset.3: correct file paths and TZ use
       [not found]             ` <54C28516.7070802-KK0ffGbhmjU@public.gmane.org>
@ 2015-01-25 13:43               ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 24+ messages in thread
From: Michael Kerrisk (man-pages) @ 2015-01-25 13:43 UTC (permalink / raw)
  To: JWP; +Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA

On 01/23/2015 06:29 PM, JWP wrote:
> Hello Michael,
> 
> I split the patch[V2] and added more details as requested.
> Is there still something wrong with my submission?
> 
> Thank you 
> Have a great weekend

Sorry, William. I have had not much chance to look at these yet,
and I was hoping someone else might review. I'll take a look
at some of them soon.

Cheers,

Michael


> On 01/18/2015 06:02 AM, Michael Kerrisk (man-pages) wrote:
>> Hello William,
>>
>> On 01/18/2015 01:34 AM, JWP wrote:
>>> Remove references to /usr/share/zoneinfo/{localtime,posixrules}
>>> as they are not used.
>>>
>>> Add information on invalid TZ values.
>>> Add information on a TZ filespec that omits the colon.
>>> Add information on system timezone configuration.
>>> Add an ENVIRONMENT section.
>>> Update the FILES section.
>>
>> Thanks for submitting this, but it's very hard for me to use
>> this patch in the submitted form. Specifically:
>>
>> * It groups a number of unrelated changes into a single patch.
>>   Could you break each logical change into a separate commit/patch
>>   please. This would allow me (and others) to independently review
>>   each piece and decide whether it should be applied.
>>
>> * Please make the patch descriptions more than just a statement of
>>   *what* you changed. Please explain what the problem was, and why 
>>   you fixed it as you did, and where it makes sense add pointers 
>>   to information that supports you reasoning.
>>
>> Thanks,
>>
>> Michael
>>
>>
>>> Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
>>> ---
>>>
>>> The following changes since commit dc70d1eaef1643ae48a9b67fcde0cd0b59bf1f20:
>>>
>>>   ld.so.8: tfix (2015-01-16 15:07:43 +0100)
>>>
>>> are available in the git repository at:
>>>
>>>   git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:jwpi/man-pages.git tzset
>>>
>>> for you to fetch changes up to 13f95862d88f041ce652ff846b2706c3d1fccf6a:
>>>
>>>   tzset.3: correct file paths and TZ use (2015-01-17 16:51:42 -0500)
>>>
>>>
>>>  man3/tzset.3 | 81 +++++++++++++++++++++++++++---------------------------------
>>>  1 file changed, 37 insertions(+), 44 deletions(-)
>>>
>>> diff --git a/man3/tzset.3 b/man3/tzset.3
>>> index c1c98e1..1058d2c 100644
>>> --- a/man3/tzset.3
>>> +++ b/man3/tzset.3
>>> @@ -30,7 +30,7 @@
>>>  .\" Modified 2001-11-13, aeb
>>>  .\" Modified 2004-12-01 mtk and Martin Schulze <joey-1lCxjdRlhQ9g9hUCZPvPmw@public.gmane.org>
>>>  .\"
>>> -.TH TZSET 3  2014-08-19 "" "Linux Programmer's Manual"
>>> +.TH TZSET 3  2015-01-16 "" "Linux Programmer's Manual"
>>>  .SH NAME
>>>  tzset, tzname, timezone, daylight \- initialize time conversion information
>>>  .SH SYNOPSIS
>>> @@ -75,15 +75,14 @@ the year when daylight saving time applies).
>>>  .PP
>>>  If the
>>>  .B TZ
>>> -variable does not appear in the environment, the \fItzname\fP
>>> -variable is initialized with the best approximation of local wall clock
>>> -time, as specified by the
>>> -.BR tzfile (5)-format
>>> -file \fIlocaltime\fP
>>> -found in the system timezone directory (see below).
>>> -(One also often sees
>>> -.I /etc/localtime
>>> -used here, a symlink to the right file in the system timezone directory.)
>>> +variable does not appear in the environment, the system timezone is used.
>>> +The system timezone is configured by copying, or linking, a file in the
>>> +.BR tzfile "(5) format to"
>>> +.IR /etc/localtime .
>>> +A timezone database of these files may be located in the system
>>> +timezone directory (see the \fBFILES\fP section below).
>>> +
>>> +
>>>  .PP
>>>  If the
>>>  .B TZ
>>> @@ -118,7 +117,7 @@ The second format is used when there is daylight saving time:
>>>  .I std offset dst [offset],start[/time],end[/time]
>>>  .RE
>>>  .sp
>>> -There are no spaces in the specification.
>>> +There are no spaces in either specification.
>>>  The initial \fIstd\fP and
>>>  \fIoffset\fP specify the standard timezone, as described above.
>>>  The \fIdst\fP string and \fIoffset\fP specify the name and offset for the
>>> @@ -170,47 +169,41 @@ from a file:
>>>  :[filespec]
>>>  .RE
>>>  .sp
>>> -If the file specification \fIfilespec\fP is omitted, the timezone
>>> -information is read from the file
>>> -.I localtime
>>> -in the system timezone directory, which nowadays usually is
>>> -.IR /usr/share/zoneinfo .
>>> -This file is in
>>> +If the file specification \fIfilespec\fP is omitted, or its value cannot
>>> +be interpreted, Coordinated Universal Time (UTC) is used.  A correct
>>> +\%\fIfilespec\fP will be a path pointing to a file in the
>>>  .BR tzfile (5)
>>> -format.
>>> -If \fIfilespec\fP is given, it specifies another
>>> -.BR tzfile (5)-format
>>> -file to read the timezone information from.
>>> -If \fIfilespec\fP does not begin with a \(aq/\(aq, the file specification is
>>> -relative to the system timezone directory.
>>> +format. A timezone database of these files may be located in the system
>>> +timezone directory (see the \fBFILES\fP section below).  If
>>> +\fIfilespec\fP does not begin with a \(aq/\(aq, the file specification
>>> +is relative to the system timezone directory. If the colon is omitted
>>> +each of the above three \fBTZ\fP formats will be tried in order.
>>>  .PP
>>>  Here's an example, once more for New Zealand:
>>>  .nf
>>>  
>>>      TZ=":Pacific/Auckland"
>>>  .fi
>>> +.SH ENVIRONMENT
>>> +.TP
>>> +.B TZ
>>> +.RB If \ TZ
>>> +is set, its value takes precedence over the system configured timezone.
>>> +.TP
>>> +.B TZDIR
>>> +.RB If \ TZDIR
>>> +is set, its value takes precedence over the system configured timezone
>>> +database directory path.
>>>  .SH FILES
>>> -Under glibc,
>>> -the system timezone directory is determined using the
>>> -.BR TZDIR
>>> -the environment variable.
>>> -If
>>> -.BR TZDIR
>>> -is not set, the default depends on the system setup, but is normally
>>> -.IR /usr/share/zoneinfo .
>>> -.LP
>>> -This timezone directory contains the files
>>> -
>>> -.nf
>>> -    localtime      local timezone file
>>> -    posixrules     rules for POSIX-style TZ's
>>> -.fi
>>> -.LP
>>> -Often,
>>> -.I /etc/localtime
>>> -is a symbolic link to the file
>>> -.I localtime
>>> -or to the correct timezone file in the system timezone directory.
>>> +.TP
>>> +.B /etc/localtime
>>> +The system timezone file.
>>> +.TP
>>> +.B /usr/share/zoneinfo/
>>> +The system timezone database directory.
>>> +.PP
>>> +Above are the current standard file locations, but they are
>>> +configurable when glibc is compiled.
>>>  .SH CONFORMING TO
>>>  SVr4, POSIX.1-2001, 4.3BSD.
>>>  .SH NOTES
>>>
>>
>>
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH[V2] 2/5] tzset.3: First TZ specification clarification
       [not found]     ` <54BC1172.5060100-KK0ffGbhmjU@public.gmane.org>
@ 2015-01-25 14:10       ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 24+ messages in thread
From: Michael Kerrisk (man-pages) @ 2015-01-25 14:10 UTC (permalink / raw)
  To: JWP; +Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA

Hello William,

On 01/18/2015 09:02 PM, JWP wrote:
> The second TZ specification states that no spaces
> are allowed, this is true for the first
> specification as well. The text of these two are
> closely coupled so including the first
> specification by using 'either' is sufficient.

I think that's a little tricky for the reader. I've instead
added a sentence in the discussion of the first format to
say that there are no spaces.

Thanks,

Michael



> Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
> ---
> 
> The following changes since commit b58839b96d626e67da233d4bf7ba04d5dfcd0e66:
> 
>   syscalls.2: Remove some details for sync_file_range2() (2015-01-18 19:56:05 +0100)
> 
> are available in the git repository at:
> 
>   git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:jwpi/man-pages.git tzset
> 
> for you to fetch changes up to 2b0725c0b6f6788628567ea4d5cfc396898584a0:
> 
>   tzset.3: TZ filespec omitts the colon (2015-01-18 14:40:21 -0500)
> 
> 
>  man3/tzset.3 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man3/tzset.3 b/man3/tzset.3
> index 36d2fd7..3f9b246 100644
> --- a/man3/tzset.3
> +++ b/man3/tzset.3
> @@ -118,7 +118,7 @@ The second format is used when there is daylight saving time:
>  .I std offset dst [offset],start[/time],end[/time]
>  .RE
>  .sp
> -There are no spaces in the specification.
> +There are no spaces in either specification.
>  The initial \fIstd\fP and
>  \fIoffset\fP specify the standard timezone, as described above.
>  The \fIdst\fP string and \fIoffset\fP specify the name and offset for the
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH[V2] 1/5] tzset.3: filespec omitted incorrect
       [not found]     ` <54BC10C7.1030706-KK0ffGbhmjU@public.gmane.org>
@ 2015-01-25 14:11       ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 24+ messages in thread
From: Michael Kerrisk (man-pages) @ 2015-01-25 14:11 UTC (permalink / raw)
  To: JWP; +Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA

On 01/18/2015 09:00 PM, JWP wrote:
> Paragraph three of the DESCRIPTION section says
> that when TZ is set, but empty, then UTC is used.
> 
> Later it says if the TZ filespec is omitted then
> the file /usr/share/zoneinfo/localtime is used.
> This is incorrect, it will use UTC in that case as
> well.

Looks good to me, William. Thanks for the patch. Applied.

Just one note on your patch titles: using the nested brackets
"[PATCH[V2]...] causes these patches to apply a little strangely.
Better would be something like "[PATCH V2 1/5]".

Cheers,

Michael


> Steps to reproduce:
> 
> cd /usr/share/zoneinfo/
> cp Antarctica/South_Pole localtime
> cd
> date
> Sun Jan 18 10:59:50 EST 2015
> TZ=:Hongkong date
> Sun Jan 18 23:59:56 HKT 2015
> TZ=:/usr/share/zoneinfo/localtime date
> Mon Jan 19 05:00:03 NZDT 2015
> TZ=: date
> Sun Jan 18 16:00:11 UTC 2015
> TZ=":" date
> Sun Jan 18 16:00:18 UTC 2015
> TZ=':' date
> Sun Jan 18 16:00:24 UTC 2015
> TZ=:/ date
> Sun Jan 18 16:00:34  2015
> TZ=":/" date
> Sun Jan 18 16:00:40  2015
> TZ="" date
> Sun Jan 18 16:00:45 UTC 2015
> 
> Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
> ---
> 
> The following changes since commit b58839b96d626e67da233d4bf7ba04d5dfcd0e66:
> 
>   syscalls.2: Remove some details for sync_file_range2() (2015-01-18 19:56:05 +0100)
> 
> are available in the git repository at:
> 
>   git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:jwpi/man-pages.git tzset
> 
> for you to fetch changes up to 2b0725c0b6f6788628567ea4d5cfc396898584a0:
> 
>   tzset.3: TZ filespec omitts the colon (2015-01-18 14:40:21 -0500)
> 
> 
>  man3/tzset.3 | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/man3/tzset.3 b/man3/tzset.3
> index c1c98e1..36d2fd7 100644
> --- a/man3/tzset.3
> +++ b/man3/tzset.3
> @@ -170,14 +170,8 @@ from a file:
>  :[filespec]
>  .RE
>  .sp
> -If the file specification \fIfilespec\fP is omitted, the timezone
> -information is read from the file
> -.I localtime
> -in the system timezone directory, which nowadays usually is
> -.IR /usr/share/zoneinfo .
> -This file is in
> -.BR tzfile (5)
> -format.
> +If the file specification \fIfilespec\fP is omitted, or its value cannot
> +be interpreted, then Coordinated Universal Time (UTC) is used.
>  If \fIfilespec\fP is given, it specifies another
>  .BR tzfile (5)-format
>  file to read the timezone information from.
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH[V2] 3/5] tzset.3: correct system timezone file path
       [not found]     ` <54BC11E2.9020906-KK0ffGbhmjU@public.gmane.org>
@ 2015-01-25 14:11       ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 24+ messages in thread
From: Michael Kerrisk (man-pages) @ 2015-01-25 14:11 UTC (permalink / raw)
  To: JWP; +Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA

On 01/18/2015 09:04 PM, JWP wrote:
> The manual incorrectly states the system timezone
> path as /usr/share/zoneinfo/localtime. Glibc does
> not use that file for anything, it uses
> $(prefix)/etc/localtime.
> 
> There is an ambiguous reference in the man-page to
> /etc/localtime, but it does not indicate that it
> will be used. It states clearly that
> /usr/share/zoneinfo/localtime is used.
> 
> A comment in the glibc Makeconfig even says that
> file should not exist:
> 
>> ... relative to $(zonedir).  It is a good idea
>> to put this somewhere other than there, so the
>> zoneinfo directory contains only universal data,
>> localizing the configuration data elsewhere.
> 
> Furthermore, the man-page does not indicate the
> reason this file is being used; which is because
> it is the configured system timezone.
> 
> A later patch in this series address the
> possibility that /etc/localtime could be changed
> during glibc's compilation. The language changed
> in this patch points to the FILE section which is
> where the explanation will be. There is no reason
> to repeat that information multiple times
> throughout the man-page.

Thanks for the well-documented patch, William. Applied.

Cheers,

Michael


> EVIDENCE:
> 
> glibc/Makeconfig:256: sysconfdir = $(prefix)/etc
> glibc/Makeconfig:272: localtime-file = $(sysconfdir)/localtime
> 
> FROM INFO LIBC:
> C.2 Installing the C Library
> ============================
>    To configure the locally used timezone, set the `TZ' environment
> variable.  The script `tzselect' helps you to select the right value.
> As an example, for Germany, `tzselect' would tell you to use
> `TZ='Europe/Berlin''.  For a system wide installation (the given paths
> are for an installation with `--prefix=/usr'), link the timezone file
> which is in `/usr/share/zoneinfo' to the file `/etc/localtime'.  For
> Germany, you might execute `ln -s /usr/share/zoneinfo/Europe/Berlin
> /etc/localtime'.
> 
> STEPS TO REPRODUCE:
> 
> cd /usr/share/zoneinfo/
> cp Antarctica/South_Pole localtime
> cp /US/Eastern /etc/localtime
> cd
> date
> Sun Jan 18 12:06:36 EST 2015
> TZ=:/usr/share/zoneinfo/localtime date
> Mon Jan 19 06:06:54 NZDT 2015
> rm /etc/localtime
> date
> Sun Jan 18 17:08:37 UTC 2015
> TZ=:/usr/share/zoneinfo/localtime date
> Mon Jan 19 06:08:41 NZDT 2015
> 
> Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
> ---
> 
> The following changes since commit b58839b96d626e67da233d4bf7ba04d5dfcd0e66:
> 
>   syscalls.2: Remove some details for sync_file_range2() (2015-01-18 19:56:05 +0100)
> 
> are available in the git repository at:
> 
>   git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:jwpi/man-pages.git tzset
> 
> for you to fetch changes up to 2b0725c0b6f6788628567ea4d5cfc396898584a0:
> 
>   tzset.3: TZ filespec omitts the colon (2015-01-18 14:40:21 -0500)
> 
> 
>  man3/tzset.3 | 15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/man3/tzset.3 b/man3/tzset.3
> index 3f9b246..09fac15 100644
> --- a/man3/tzset.3
> +++ b/man3/tzset.3
> @@ -75,15 +75,12 @@ the year when daylight saving time applies).
>  .PP
>  If the
>  .B TZ
> -variable does not appear in the environment, the \fItzname\fP
> -variable is initialized with the best approximation of local wall clock
> -time, as specified by the
> -.BR tzfile (5)-format
> -file \fIlocaltime\fP
> -found in the system timezone directory (see below).
> -(One also often sees
> -.I /etc/localtime
> -used here, a symlink to the right file in the system timezone directory.)
> +variable does not appear in the environment, the system timezone is used.
> +The system timezone is configured by copying, or linking, a file in the
> +.BR tzfile "(5) format to"
> +.IR /etc/localtime .
> +A timezone database of these files may be located in the system
> +timezone directory (see the \fBFILES\fP section below).
>  .PP
>  If the
>  .B TZ
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH[V2] 5/5] tzset.3: TZ filespec omitts the colon
       [not found]     ` <54BC132A.8090504-KK0ffGbhmjU@public.gmane.org>
@ 2015-01-25 14:11       ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 24+ messages in thread
From: Michael Kerrisk (man-pages) @ 2015-01-25 14:11 UTC (permalink / raw)
  To: JWP; +Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA

On 01/18/2015 09:10 PM, JWP wrote:
> If the TZ filespec omits the leading colon, glibc
> will parse it for any valid format, i.e., it will
> still work.
> 
> STEPS TO REPRODUCE:
> TZ=:Europe/Kiev date
> Sun Jan 18 20:19:13 EET 2015
> TZ=Europe/Kiev date
> Sun Jan 18 20:19:20 EET 2015

Thanks, William. Applied.

Cheers,

Michael


> Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
> ---
> 
> The following changes since commit b58839b96d626e67da233d4bf7ba04d5dfcd0e66:
> 
>   syscalls.2: Remove some details for sync_file_range2() (2015-01-18 19:56:05 +0100)
> 
> are available in the git repository at:
> 
>   git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:jwpi/man-pages.git tzset
> 
> for you to fetch changes up to 2b0725c0b6f6788628567ea4d5cfc396898584a0:
> 
>   tzset.3: TZ filespec omitts the colon (2015-01-18 14:40:21 -0500)
> 
> 
>  man3/tzset.3 | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/man3/tzset.3 b/man3/tzset.3
> index b49c8ee..5c721b6 100644
> --- a/man3/tzset.3
> +++ b/man3/tzset.3
> @@ -173,7 +173,8 @@ If \fIfilespec\fP is given, it specifies another
>  .BR tzfile (5)-format
>  file to read the timezone information from.
>  If \fIfilespec\fP does not begin with a \(aq/\(aq, the file specification is
> -relative to the system timezone directory.
> +relative to the system timezone directory.  If the colon is omitted each
> +of the above three \fBTZ\fP formats will be tried in order.
>  .PP
>  Here's an example, once more for New Zealand:
>  .nf
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH[V2] 4/5] tzset.3: Add Environment section
       [not found]     ` <54BC126E.1080904-KK0ffGbhmjU@public.gmane.org>
@ 2015-01-25 14:12       ` Michael Kerrisk (man-pages)
       [not found]         ` <54C4F9E7.6090104-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Michael Kerrisk (man-pages) @ 2015-01-25 14:12 UTC (permalink / raw)
  To: JWP; +Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA

Hi William,

On 01/18/2015 09:07 PM, JWP wrote:
> FILES section was overly verbose and included
> environment variables.  Added ENVIRONMENT section,
> removing ENV VARS from the FILES section.
> Corrected Files section items.
> 
> As stated in the previous commit
> /usr/share/zoneinfo/localtime
> is not used, nor recommended by glibc.

I suspect this patch might have been better split into the piece
above and below, because the piece below seems somewhat distinct,
and also I wonder about its correctness.

> Also not used is:
> /usr/share/zoneinfo/posixrules
> 
> STEPS TO REPRODUCE NO posixrules:
> 
> TZ=EST+5EDT,M1.3.0/2,M10.5.0/2 date
> Sun Jan 18 14:01:24 EDT 2015
> TZ=EST+5EDT,M1.4.0/2,M10.5.0/2 date
> Sun Jan 18 13:01:27 EST 2015

Two questions:
* I need some help with the shell output above. How does
  it demonstrate that posixrules is not used?
* Are you sure about this? A cursory grep through the 
  glibc source shows instances of the string "posixrules".
  See also the zic(8) man page.

While waiting to clear this up, I've not applied this patch.

Thanks,

Michael


> Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
> ---
> 
> The following changes since commit b58839b96d626e67da233d4bf7ba04d5dfcd0e66:
> 
>   syscalls.2: Remove some details for sync_file_range2() (2015-01-18 19:56:05 +0100)
> 
> are available in the git repository at:
> 
>   git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:jwpi/man-pages.git tzset
> 
> for you to fetch changes up to 2b0725c0b6f6788628567ea4d5cfc396898584a0:
> 
>   tzset.3: TZ filespec omitts the colon (2015-01-18 14:40:21 -0500)
> 
> 
>  man3/tzset.3 | 40 +++++++++++++++++++---------------------
>  1 file changed, 19 insertions(+), 21 deletions(-)
> 
> diff --git a/man3/tzset.3 b/man3/tzset.3
> index 09fac15..b49c8ee 100644
> --- a/man3/tzset.3
> +++ b/man3/tzset.3
> @@ -180,28 +180,26 @@ Here's an example, once more for New Zealand:
>  
>      TZ=":Pacific/Auckland"
>  .fi
> +.SH ENVIRONMENT
> +.TP
> +.B TZ
> +.RB If \ TZ
> +is set, its value takes precedence over the system configured timezone.
> +.TP
> +.B TZDIR
> +.RB If \ TZDIR
> +is set, its value takes precedence over the system configured timezone
> +database directory path.
>  .SH FILES
> -Under glibc,
> -the system timezone directory is determined using the
> -.BR TZDIR
> -the environment variable.
> -If
> -.BR TZDIR
> -is not set, the default depends on the system setup, but is normally
> -.IR /usr/share/zoneinfo .
> -.LP
> -This timezone directory contains the files
> -
> -.nf
> -    localtime      local timezone file
> -    posixrules     rules for POSIX-style TZ's
> -.fi
> -.LP
> -Often,
> -.I /etc/localtime
> -is a symbolic link to the file
> -.I localtime
> -or to the correct timezone file in the system timezone directory.
> +.TP
> +.B /etc/localtime
> +The system timezone file.
> +.TP
> +.B /usr/share/zoneinfo/
> +The system timezone database directory.
> +.PP
> +Above are the current standard file locations, but they are
> +configurable when glibc is compiled.
>  .SH CONFORMING TO
>  SVr4, POSIX.1-2001, 4.3BSD.
>  .SH NOTES
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH[V2] 4/5] tzset.3: Add Environment section
       [not found]         ` <54C4F9E7.6090104-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-01-28 23:52           ` JWP
  2015-01-29  0:09           ` [PATCH V3 1/1] " J William Piggott
  2015-01-29  0:13           ` [PATCH 1/1] tzset.3: Add description for posixrules file J William Piggott
  2 siblings, 0 replies; 24+ messages in thread
From: JWP @ 2015-01-28 23:52 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

On 01/25/2015 09:12 AM, Michael Kerrisk (man-pages) wrote:
>> Also not used is:
>> /usr/share/zoneinfo/posixrules
>>
>> STEPS TO REPRODUCE NO posixrules:
>>
>> TZ=EST+5EDT,M1.3.0/2,M10.5.0/2 date
>> Sun Jan 18 14:01:24 EDT 2015
>> TZ=EST+5EDT,M1.4.0/2,M10.5.0/2 date
>> Sun Jan 18 13:01:27 EST 2015
> 
> Two questions:
> * I need some help with the shell output above. How does
>   it demonstrate that posixrules is not used?
> * Are you sure about this? A cursory grep through the 
>   glibc source shows instances of the string "posixrules".
>   See also the zic(8) man page.

Good catch Michael, I was indeed wrong. I based my position on the
following information from the zoneinfo Makefile:

# (When a POSIX-style environment variable is handled, the rules in the
# template file are used to determine "spring forward" and "fall back" days and
# times; the environment variable itself specifies UT offsets of standard and
# summer time.)

As you correctly pointed out, I should have looked at what glibc is
doing, not zoneinfo. Upon reviewing the glibc source the poxsixrules are
being used for very specific TZ strings that can be represented as:

[:]stdoffsetdst[offset][,]

If anything follows the above string, even invalid data, posixrules will
not be used. Below is some shell output demonstrating this.

I've posted v3 of this patch that includes the posixrule file, and a new
patch that adds a description of the file.

In the process of reading the source I have found a few more
discrepancies in the man-page... I will address those later.

Thank you for the heads up on not nesting brackets in patch titles, and for
taking the time to review and commit my work.

PS: zic's -l and -p options are just a user convenience to create the
localtime and posixrules links in the zoneinfo directory. zic doesn't
actually use the posixrules file for compiling.

In this demo the posixrules file is hard linked to America/New_York.
Notice the change to standard time when it is used.

$ TZ="NZST-12:00:00NZDT-13:00:00,M10.1.0/02:00:00,M3.3.0/02:00:00" \
> strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'
Thu Jan 29 06:53:01 NZDT 2015

$ TZ="NZST-12:00:00NZDT-13:00:00,ANYTHING" \
> strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'
Thu Jan 29 06:53:35 NZDT 2015

$ TZ="NZST-12:00:00NZDT,ANYTHING" \
> strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'
Thu Jan 29 06:53:58 NZDT 2015

$ TZ="NZST-12:00:00NZDT-13:00:00," \
> strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'
open("/usr/share/zoneinfo/posixrules", O_RDONLY|O_CLOEXEC) = 3
Thu Jan 29 05:54:58 NZST 2015

$ TZ="NZST-12:00:00NZDT," \
> strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'
open("/usr/share/zoneinfo/posixrules", O_RDONLY|O_CLOEXEC) = 3
Thu Jan 29 05:55:13 NZST 2015

$ TZ="NZST-12:00:00NZDT" \
> strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'
open("/usr/share/zoneinfo/posixrules", O_RDONLY|O_CLOEXEC) = 3
Thu Jan 29 05:55:30 NZST 2015

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V3 1/1] tzset.3: Add Environment section
       [not found]         ` <54C4F9E7.6090104-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2015-01-28 23:52           ` JWP
@ 2015-01-29  0:09           ` J William Piggott
       [not found]             ` <54C97A2D.2050908-KK0ffGbhmjU@public.gmane.org>
  2015-01-29  0:13           ` [PATCH 1/1] tzset.3: Add description for posixrules file J William Piggott
  2 siblings, 1 reply; 24+ messages in thread
From: J William Piggott @ 2015-01-29  0:09 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA


FILES section was overly verbose and included
environment variables.  Added ENVIRONMENT section,
removing ENV VARS from the FILES section.

As stated in commit 2c7f200
/usr/share/zoneinfo/localtime
is not used, nor recommended by glibc.

Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
---

The following changes since commit 91907c29c02f8ac81b1c4f7e62495b00cc005ed7:

  kexec_load.2: srcfix: add mtk to copyright list (2015-01-28 21:56:38 +0100)

are available in the git repository at:

  git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:jwpi/man-pages.git tzsetv3

for you to fetch changes up to 254e03f0c6864175df80f185ec78b9c75c7b8baa:

  tzset.3: Add description for posixrules file (2015-01-28 17:26:06 -0500)


 man3/tzset.3 | 42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/man3/tzset.3 b/man3/tzset.3
index 81fbabe..9011e5f 100644
--- a/man3/tzset.3
+++ b/man3/tzset.3
@@ -182,28 +182,28 @@ Here's an example, once more for New Zealand:
      TZ=":Pacific/Auckland"
 .fi
+.SH ENVIRONMENT
+.TP
+.B TZ
+.RB If \ TZ
+is set, its value takes precedence over the system configured timezone.
+.TP
+.B TZDIR
+.RB If \ TZDIR
+is set, its value takes precedence over the system configured timezone
+database directory path.
 .SH FILES
-Under glibc,
-the system timezone directory is determined using the
-.BR TZDIR
-the environment variable.
-If
-.BR TZDIR
-is not set, the default depends on the system setup, but is normally
-.IR /usr/share/zoneinfo .
-.LP
-This timezone directory contains the files

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 1/1] tzset.3: Add description for posixrules file
       [not found]         ` <54C4F9E7.6090104-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2015-01-28 23:52           ` JWP
  2015-01-29  0:09           ` [PATCH V3 1/1] " J William Piggott
@ 2015-01-29  0:13           ` J William Piggott
       [not found]             ` <54C97B45.2070300-KK0ffGbhmjU@public.gmane.org>
  2 siblings, 1 reply; 24+ messages in thread
From: J William Piggott @ 2015-01-29  0:13 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA


Based upon reviewing the glibc source, the posixrules file is being used
for very specific TZ strings that can be represented as:

[:]stdoffsetdst[offset][,]

If anything follows the above string, even invalid data, posixrules will
not be used. Below is some shell output demonstrating this.

$ TZ="NZST-12:00:00NZDT-13:00:00,ANYTHING" \
> strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'
Thu Jan 29 06:53:35 NZDT 2015

$ TZ="NZST-12:00:00NZDT-13:00:00," \
> strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'
open("/usr/share/zoneinfo/posixrules", O_RDONLY|O_CLOEXEC) = 3
Thu Jan 29 05:54:58 NZST 2015

Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
---
 man3/tzset.3 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/man3/tzset.3 b/man3/tzset.3
index 9011e5f..2e91fd8 100644
--- a/man3/tzset.3
+++ b/man3/tzset.3
@@ -201,6 +201,11 @@ The system timezone file.
 The system timezone database directory.
 .TP
 .B /usr/share/zoneinfo/posixrules
+When a TZ string includes a dst timezone without anything following it,
+then this file is used for the start/end rules. It is in the
+.B tzfile(5)
+format. By default, the zoneinfo Makefile hard links it to the
+.IR America/New_York " tzfile."
 .PP
 Above are the current standard file locations, but they are
 configurable when glibc is compiled.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH V3 1/1] tzset.3: Add Environment section
       [not found]             ` <54C97A2D.2050908-KK0ffGbhmjU@public.gmane.org>
@ 2015-01-29  5:50               ` Michael Kerrisk (man-pages)
       [not found]                 ` <54C9CA11.207-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Michael Kerrisk (man-pages) @ 2015-01-29  5:50 UTC (permalink / raw)
  To: J William Piggott
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA

Hi William,

Both of your patches don't apply. I've not looked closely at
why. Could you check them please. See also comments below

On 01/29/2015 01:09 AM, J William Piggott wrote:
> --- a/man3/tzset.3
> +++ b/man3/tzset.3
> @@ -182,28 +182,28 @@ Here's an example, once more for New Zealand:
>       TZ=":Pacific/Auckland"
>  .fi
> +.SH ENVIRONMENT
> +.TP
> +.B TZ
> +.RB If \ TZ
> +is set, 

Just make this: "If this variable is set..."

> its value takes precedence over the system configured timezone.
> +.TP
> +.B TZDIR
> +.RB If \ TZDIR
> +is set, 

Just make this: "If this variable is set..."

> its value takes precedence over the system configured timezone
> +database directory path.
>  .SH FILES
> -Under glibc,
> -the system timezone directory is determined using the
> -.BR TZDIR
> -the environment variable.
> -If
> -.BR TZDIR
> -is not set, the default depends on the system setup, but is normally
> -.IR /usr/share/zoneinfo .
> -.LP
> -This timezone directory contains the files
> -
> -.nf
> -    localtime      local timezone file
> -    posixrules     rules for POSIX-style TZ's
> -.fi
> -.LP
> -Often,
> -.I /etc/localtime
> -is a symbolic link to the file
> -.I localtime
> -or to the correct timezone file in the system timezone directory.
> +.TP
> +.B /etc/localtime
> +The system timezone file.
> +.TP
> +.B /usr/share/zoneinfo/
> +The system timezone database directory.
> +.TP
> +.B /usr/share/zoneinfo/posixrules
> +.PP
> +Above are the current standard file locations, but they are
> +configurable when glibc is compiled.
>  .SH CONFORMING TO
>  SVr4, POSIX.1-2001, 4.3BSD.
>  .SH NOTES

Thanks,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/1] tzset.3: Add description for posixrules file
       [not found]             ` <54C97B45.2070300-KK0ffGbhmjU@public.gmane.org>
@ 2015-01-29  5:51               ` Michael Kerrisk (man-pages)
       [not found]                 ` <54C9CA67.4080009-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Michael Kerrisk (man-pages) @ 2015-01-29  5:51 UTC (permalink / raw)
  To: J William Piggott
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA

Hi William,

This patch also does not apply. Some comments also below.

On 01/29/2015 01:13 AM, J William Piggott wrote:
> 
> Based upon reviewing the glibc source, the posixrules file is being used
> for very specific TZ strings that can be represented as:
> 
> [:]stdoffsetdst[offset][,]
> 
> If anything follows the above string, even invalid data, posixrules will
> not be used. Below is some shell output demonstrating this.
> 
> $ TZ="NZST-12:00:00NZDT-13:00:00,ANYTHING" \
>> strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'
> Thu Jan 29 06:53:35 NZDT 2015
> 
> $ TZ="NZST-12:00:00NZDT-13:00:00," \
>> strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'
> open("/usr/share/zoneinfo/posixrules", O_RDONLY|O_CLOEXEC) = 3
> Thu Jan 29 05:54:58 NZST 2015
> 
> Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
> ---
>  man3/tzset.3 | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/man3/tzset.3 b/man3/tzset.3
> index 9011e5f..2e91fd8 100644
> --- a/man3/tzset.3
> +++ b/man3/tzset.3
> @@ -201,6 +201,11 @@ The system timezone file.
>  The system timezone database directory.
>  .TP
>  .B /usr/share/zoneinfo/posixrules
> +When a TZ string includes a dst timezone without anything following it,
> +then this file is used for the start/end rules. It is in the

Please start new sentences on new source lines. (See man-pages(7).)

> +.B tzfile(5)
> +format. By default, the zoneinfo Makefile hard links it to the

As above.

> +.IR America/New_York " tzfile."
>  .PP
>  Above are the current standard file locations, but they are
>  configurable when glibc is compiled.
> 

Thanks,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V4 1/1] tzset.3: Add Environment section
       [not found]                 ` <54C9CA11.207-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-01-29 16:27                   ` J William Piggott
       [not found]                     ` <54CA5F5B.7070405-KK0ffGbhmjU@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: J William Piggott @ 2015-01-29 16:27 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

FILES section was overly verbose and included
environment variables.  Added ENVIRONMENT section,
removing ENV VARS from the FILES section.

As stated in commit 2c7f200
/usr/share/zoneinfo/localtime
is not used, nor recommended by glibc.

Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
---
 man3/tzset.3 | 41 ++++++++++++++++++++---------------------
 1 file changed, 20 insertions(+), 21 deletions(-)

diff --git a/man3/tzset.3 b/man3/tzset.3
index 81fbabe..a9b088d 100644
--- a/man3/tzset.3
+++ b/man3/tzset.3
@@ -182,28 +182,27 @@ Here's an example, once more for New Zealand:
 
     TZ=":Pacific/Auckland"
 .fi
+.SH ENVIRONMENT
+.TP
+.B TZ
+If this variable is set its value takes precedence over the system
+configured timezone.
+.TP
+.B TZDIR
+If this variable is set its value takes precedence over the system
+configured timezone database directory path.
 .SH FILES
-Under glibc,
-the system timezone directory is determined using the
-.BR TZDIR
-the environment variable.
-If
-.BR TZDIR
-is not set, the default depends on the system setup, but is normally
-.IR /usr/share/zoneinfo .
-.LP
-This timezone directory contains the files

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH V2 1/1] tzset.3: Add description for posixrules file
       [not found]                 ` <54C9CA67.4080009-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-01-29 16:31                   ` J William Piggott
       [not found]                     ` <54CA604A.1050500-KK0ffGbhmjU@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: J William Piggott @ 2015-01-29 16:31 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

Based upon reviewing the glibc source, the posixrules file is being used
for very specific TZ strings that can be represented as:

[:]stdoffsetdst[offset][,]

If anything follows the above string, even invalid data, posixrules will
not be used. Below is some shell output demonstrating this.

$ TZ="NZST-12:00:00NZDT-13:00:00,ANYTHING" \
strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'
Thu Jan 29 06:53:35 NZDT 2015

$ TZ="NZST-12:00:00NZDT-13:00:00," \
strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'
open("/usr/share/zoneinfo/posixrules", O_RDONLY|O_CLOEXEC) = 3
Thu Jan 29 05:54:58 NZST 2015

Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
---
 man3/tzset.3 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/man3/tzset.3 b/man3/tzset.3
index a9b088d..9cb9d32 100644
--- a/man3/tzset.3
+++ b/man3/tzset.3
@@ -200,6 +200,12 @@ The system timezone file.
 The system timezone database directory.
 .TP
 .B /usr/share/zoneinfo/posixrules
+When a TZ string includes a dst timezone without anything following it,
+then this file is used for the start/end rules.
+It is in the
+.BR tzfile "(5) format."
+By default, the zoneinfo Makefile hard links it to the
+.IR America/New_York " tzfile."
 .PP
 Above are the current standard file locations, but they are
 configurable when glibc is compiled.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH V4 1/1] tzset.3: Add Environment section
       [not found]                     ` <54CA5F5B.7070405-KK0ffGbhmjU@public.gmane.org>
@ 2015-01-30  6:04                       ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 24+ messages in thread
From: Michael Kerrisk (man-pages) @ 2015-01-30  6:04 UTC (permalink / raw)
  To: J William Piggott
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA

On 01/29/2015 05:27 PM, J William Piggott wrote:
> FILES section was overly verbose and included
> environment variables.  Added ENVIRONMENT section,
> removing ENV VARS from the FILES section.
> 
> As stated in commit 2c7f200
> /usr/share/zoneinfo/localtime
> is not used, nor recommended by glibc.

Thanks, William! Applied.

Cheers,

Michael


> Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
> ---
>  man3/tzset.3 | 41 ++++++++++++++++++++---------------------
>  1 file changed, 20 insertions(+), 21 deletions(-)
> 
> diff --git a/man3/tzset.3 b/man3/tzset.3
> index 81fbabe..a9b088d 100644
> --- a/man3/tzset.3
> +++ b/man3/tzset.3
> @@ -182,28 +182,27 @@ Here's an example, once more for New Zealand:
>  
>      TZ=":Pacific/Auckland"
>  .fi
> +.SH ENVIRONMENT
> +.TP
> +.B TZ
> +If this variable is set its value takes precedence over the system
> +configured timezone.
> +.TP
> +.B TZDIR
> +If this variable is set its value takes precedence over the system
> +configured timezone database directory path.
>  .SH FILES
> -Under glibc,
> -the system timezone directory is determined using the
> -.BR TZDIR
> -the environment variable.
> -If
> -.BR TZDIR
> -is not set, the default depends on the system setup, but is normally
> -.IR /usr/share/zoneinfo .
> -.LP
> -This timezone directory contains the files
> -
> -.nf
> -    localtime      local timezone file
> -    posixrules     rules for POSIX-style TZ's
> -.fi
> -.LP
> -Often,
> -.I /etc/localtime
> -is a symbolic link to the file
> -.I localtime
> -or to the correct timezone file in the system timezone directory.
> +.TP
> +.B /etc/localtime
> +The system timezone file.
> +.TP
> +.B /usr/share/zoneinfo/
> +The system timezone database directory.
> +.TP
> +.B /usr/share/zoneinfo/posixrules
> +.PP
> +Above are the current standard file locations, but they are
> +configurable when glibc is compiled.
>  .SH CONFORMING TO
>  SVr4, POSIX.1-2001, 4.3BSD.
>  .SH NOTES
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH V2 1/1] tzset.3: Add description for posixrules file
       [not found]                     ` <54CA604A.1050500-KK0ffGbhmjU@public.gmane.org>
@ 2015-01-30  6:04                       ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 24+ messages in thread
From: Michael Kerrisk (man-pages) @ 2015-01-30  6:04 UTC (permalink / raw)
  To: J William Piggott
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w, linux-man-u79uwXL29TY76Z2rM5mHXA

On 01/29/2015 05:31 PM, J William Piggott wrote:
> Based upon reviewing the glibc source, the posixrules file is being used
> for very specific TZ strings that can be represented as:
> 
> [:]stdoffsetdst[offset][,]
> 
> If anything follows the above string, even invalid data, posixrules will
> not be used. Below is some shell output demonstrating this.
> 
> $ TZ="NZST-12:00:00NZDT-13:00:00,ANYTHING" \
> strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'
> Thu Jan 29 06:53:35 NZDT 2015
> 
> $ TZ="NZST-12:00:00NZDT-13:00:00," \
> strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'
> open("/usr/share/zoneinfo/posixrules", O_RDONLY|O_CLOEXEC) = 3
> Thu Jan 29 05:54:58 NZST 2015

Thanks, William. Applied.

Cheers,

Michael



> Signed-off-by: J William Piggott <elseifthen-KK0ffGbhmjU@public.gmane.org>
> ---
>  man3/tzset.3 | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/man3/tzset.3 b/man3/tzset.3
> index a9b088d..9cb9d32 100644
> --- a/man3/tzset.3
> +++ b/man3/tzset.3
> @@ -200,6 +200,12 @@ The system timezone file.
>  The system timezone database directory.
>  .TP
>  .B /usr/share/zoneinfo/posixrules
> +When a TZ string includes a dst timezone without anything following it,
> +then this file is used for the start/end rules.
> +It is in the
> +.BR tzfile "(5) format."
> +By default, the zoneinfo Makefile hard links it to the
> +.IR America/New_York " tzfile."
>  .PP
>  Above are the current standard file locations, but they are
>  configurable when glibc is compiled.
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2015-01-30  6:04 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-18  0:30 [PATCH][COVER LETTER] tzset.3: correct file paths and TZ use JWP
     [not found] ` <54BAFE98.2090402-KK0ffGbhmjU@public.gmane.org>
2015-01-18  0:34   ` [PATCH] " JWP
     [not found]     ` <54BAFFAE.2020106-KK0ffGbhmjU@public.gmane.org>
2015-01-18 11:02       ` Michael Kerrisk (man-pages)
     [not found]         ` <54BB92AE.4090604-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-01-23 17:29           ` JWP
     [not found]             ` <54C28516.7070802-KK0ffGbhmjU@public.gmane.org>
2015-01-25 13:43               ` Michael Kerrisk (man-pages)
2015-01-18 20:00   ` [PATCH[V2] 1/5] tzset.3: filespec omitted incorrect JWP
     [not found]     ` <54BC10C7.1030706-KK0ffGbhmjU@public.gmane.org>
2015-01-25 14:11       ` Michael Kerrisk (man-pages)
2015-01-18 20:02   ` [PATCH[V2] 2/5] tzset.3: First TZ specification clarification JWP
     [not found]     ` <54BC1172.5060100-KK0ffGbhmjU@public.gmane.org>
2015-01-25 14:10       ` Michael Kerrisk (man-pages)
2015-01-18 20:04   ` [PATCH[V2] 3/5] tzset.3: correct system timezone file path JWP
     [not found]     ` <54BC11E2.9020906-KK0ffGbhmjU@public.gmane.org>
2015-01-25 14:11       ` Michael Kerrisk (man-pages)
2015-01-18 20:07   ` [PATCH[V2] 4/5] tzset.3: Add Environment section JWP
     [not found]     ` <54BC126E.1080904-KK0ffGbhmjU@public.gmane.org>
2015-01-25 14:12       ` Michael Kerrisk (man-pages)
     [not found]         ` <54C4F9E7.6090104-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-01-28 23:52           ` JWP
2015-01-29  0:09           ` [PATCH V3 1/1] " J William Piggott
     [not found]             ` <54C97A2D.2050908-KK0ffGbhmjU@public.gmane.org>
2015-01-29  5:50               ` Michael Kerrisk (man-pages)
     [not found]                 ` <54C9CA11.207-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-01-29 16:27                   ` [PATCH V4 " J William Piggott
     [not found]                     ` <54CA5F5B.7070405-KK0ffGbhmjU@public.gmane.org>
2015-01-30  6:04                       ` Michael Kerrisk (man-pages)
2015-01-29  0:13           ` [PATCH 1/1] tzset.3: Add description for posixrules file J William Piggott
     [not found]             ` <54C97B45.2070300-KK0ffGbhmjU@public.gmane.org>
2015-01-29  5:51               ` Michael Kerrisk (man-pages)
     [not found]                 ` <54C9CA67.4080009-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-01-29 16:31                   ` [PATCH V2 " J William Piggott
     [not found]                     ` <54CA604A.1050500-KK0ffGbhmjU@public.gmane.org>
2015-01-30  6:04                       ` Michael Kerrisk (man-pages)
2015-01-18 20:10   ` [PATCH[V2] 5/5] tzset.3: TZ filespec omitts the colon JWP
     [not found]     ` <54BC132A.8090504-KK0ffGbhmjU@public.gmane.org>
2015-01-25 14:11       ` Michael Kerrisk (man-pages)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.