Skip to contentSkip to conversation

tzset.3: correct file paths and TZ use

PATCH New JWP 2 participants 24 messages Jan 18, 2015 – Jan 30, 2015 16 messages not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore

JWP

author
#0 lore raw

PATCH 1/1 tzset.3: correct file paths and TZ use

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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#2 lore raw

PATCH 1/1 tzset.3: correct file paths and TZ use

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.

---

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/[email protected]: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(-)
man3/tzset.3 +28 -33
index c1c98e1..1058d2c 100644
@@ -30,7 +30,7 @@
 .\" Modified 2001-11-13, aeb
 .\" Modified 2004-12-01 mtk and Martin Schulze <[email protected]>
 .\"
-.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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Hello William,

Quoted 8 lines · JWP

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

Quoted 141 lines

---

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/[email protected]: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(-)
man3/tzset.3 +37 -44
index c1c98e1..1058d2c 100644
@@ -30,7 +30,7 @@
 .\" Modified 2001-11-13, aeb
 .\" Modified 2004-12-01 mtk and Martin Schulze <[email protected]>
 .\"
-.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
Signature · 7 lines
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#6 lore raw

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

Quoted 163 lines · Michael Kerrisk (man-pages)

Hello William,

Quoted 8 lines · JWP

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

Quoted 133 lines

---

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/[email protected]: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(-)
man3/tzset.3 +33 -44
index c1c98e1..1058d2c 100644
@@ -30,7 +30,7 @@
 .\" Modified 2001-11-13, aeb
 .\" Modified 2004-12-01 mtk and Martin Schulze <[email protected]>
 .\"
-.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/
Quoted 10 lines

man3/tzset.3 from a file: · line 209

Quoted 8 lines
man3/tzset.3 +4 -0
+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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 7 lines · JWP

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

Quoted 175 lines · Michael Kerrisk (man-pages)
Quoted 173 lines

Hello William,

Quoted 8 lines · JWP

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

Quoted 141 lines

---

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/[email protected]: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(-)
man3/tzset.3 +37 -44
index c1c98e1..1058d2c 100644
@@ -30,7 +30,7 @@
 .\" Modified 2001-11-13, aeb
 .\" Modified 2004-12-01 mtk and Martin Schulze <[email protected]>
 .\"
-.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
Signature · 7 lines
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#9 lore raw

PATCH v2 1/1 1/5] tzset.3: filespec omitted incorrect

In reply to a message not in the archive

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

---

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/[email protected]: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(-)
man3/tzset.3 +2 -8
index c1c98e1..36d2fd7 100644
@@ -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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#11 lore raw

Re: [PATCH[V2] 1/5] tzset.3: filespec omitted incorrect

Quoted 7 lines · JWP

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

Quoted 65 lines

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

---

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/[email protected]: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(-)
man3/tzset.3 +2 -8
index c1c98e1..36d2fd7 100644
@@ -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.
Signature · 7 lines
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#12 lore raw

PATCH v2 1/1 2/5] tzset.3: First TZ specification clarification

In reply to a message not in the archive

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.

---

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/[email protected]: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(-)
man3/tzset.3 +1 -1
index 36d2fd7..3f9b246 100644
@@ -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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#14 lore raw

Re: [PATCH[V2] 2/5] tzset.3: First TZ specification clarification

Hello William,

Quoted 5 lines · JWP

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

Quoted 33 lines

---

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/[email protected]: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(-)
man3/tzset.3 +1 -1
index 36d2fd7..3f9b246 100644
@@ -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
Signature · 7 lines
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#15 lore raw

PATCH v2 1/1 3/5] tzset.3: correct system timezone file path

In reply to a message not in the archive

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:

Quoted 4 lines

... 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

---

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/[email protected]: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(-)
man3/tzset.3 +6 -9
index 3f9b246..09fac15 100644
@@ -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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#17 lore raw

Re: [PATCH[V2] 3/5] tzset.3: correct system timezone file path

Quoted 22 lines · JWP

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:

Quoted 4 lines

... 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.

Quoted 7 lines

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

Quoted 79 lines

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

---

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/[email protected]: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(-)
man3/tzset.3 +6 -9
index 3f9b246..09fac15 100644
@@ -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
Signature · 7 lines
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#18 lore raw

PATCH v2 1/1 4/5] tzset.3: Add Environment section

In reply to a message not in the archive

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

---

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/[email protected]: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(-)
man3/tzset.3 +10 -10
index 09fac15..b49c8ee 100644
@@ -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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#20 lore raw

Re: [PATCH[V2] 4/5] tzset.3: Add Environment section

Hi William,

Quoted 8 lines · JWP

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.

Quoted 9 lines

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

Quoted 72 lines

---

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/[email protected]: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(-)
man3/tzset.3 +19 -21
index 09fac15..b49c8ee 100644
@@ -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
Signature · 7 lines
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#22 lore raw

Re: [PATCH[V2] 4/5] tzset.3: Add Environment section

Quoted 10 lines · Michael Kerrisk (man-pages)
Quoted 9 lines

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

Quoted 6 lines

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" \
Quoted 1 line

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" \
Quoted 1 line

strace -eopen date 2>&1 | grep -Ei 'posixrules|jan'

Thu Jan 29 06:53:35 NZDT 2015

$ TZ="NZST-12:00:00NZDT,ANYTHING" \
Quoted 1 line

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," \
Quoted 1 line

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," \
Quoted 1 line

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" \
Quoted 1 line

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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#23 lore raw

PATCH v3 1/1 tzset.3: Add Environment section

In reply to a message not in the archive

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.

---

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/[email protected]: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(-)
man3/tzset.3 +10 -10
index 81fbabe..9011e5f 100644
@@ -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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#25 lore raw

Re: [PATCH V3 1/1] tzset.3: Add Environment section

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

man3/tzset.3 Here's an example, once more for New Zealand: · line 188

Quoted 10 lines · J William Piggott
man3/tzset.3 +5 -0
@@ -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..."

Quoted 5 lines

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..."

Quoted 28 lines

its value takes precedence over the system configured timezone

man3/tzset.3 +5 -21
+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

man3/tzset.3

Quoted 10 lines
man3/tzset.3 +7 -0
+.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

Signature · 7 lines
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#27 lore raw

PATCH v4 1/1 tzset.3: Add Environment section

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.

---
 man3/tzset.3 | 41 ++++++++++++++++++++---------------------
 1 file changed, 20 insertions(+), 21 deletions(-)
man3/tzset.3 +9 -10
index 81fbabe..a9b088d 100644
@@ -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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#29 lore raw

Re: [PATCH V4 1/1] tzset.3: Add Environment section

Quoted 7 lines · J William Piggott

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

Quoted 59 lines
---
 man3/tzset.3 | 41 ++++++++++++++++++++---------------------
 1 file changed, 20 insertions(+), 21 deletions(-)
man3/tzset.3 +20 -21
index 81fbabe..a9b088d 100644
@@ -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
Signature · 7 lines
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#30 lore raw

PATCH 1/1 tzset.3: Add description for posixrules file

In reply to a message not in the archive

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" \
Quoted 1 line

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," \
Quoted 1 line

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

---
 man3/tzset.3 | 5 +++++
 1 file changed, 5 insertions(+)
man3/tzset.3 +5 -0
index 9011e5f..2e91fd8 100644
@@ -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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#32 lore raw

Re: [PATCH 1/1] tzset.3: Add description for posixrules file

Hi William,

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

Quoted 28 lines · J William Piggott

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" \
Quoted 1 line

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," \
Quoted 1 line

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

---
 man3/tzset.3 | 5 +++++
 1 file changed, 5 insertions(+)
man3/tzset.3 +0 -0
index 9011e5f..2e91fd8 100644

man3/tzset.3 The system timezone file. · line 205

Quoted 5 lines
man3/tzset.3 +2 -0
@@ -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).)

man3/tzset.3 The system timezone file. · line 207

Quoted 2 lines
man3/tzset.3 +2 -0
+.B tzfile(5)
+format. By default, the zoneinfo Makefile hard links it to the

As above.

man3/tzset.3 The system timezone file. · line 211

Quoted 5 lines
man3/tzset.3 +1 -0
+.IR America/New_York " tzfile."
 .PP
 Above are the current standard file locations, but they are
 configurable when glibc is compiled.

Thanks,

Michael

Signature · 7 lines
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#34 lore raw

PATCH v2 1/1 tzset.3: Add description for posixrules file

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
---
 man3/tzset.3 | 6 ++++++
 1 file changed, 6 insertions(+)
man3/tzset.3 +6 -0
index a9b088d..9cb9d32 100644
@@ -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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#36 lore raw

Re: [PATCH V2 1/1] tzset.3: Add description for posixrules file

Quoted 8 lines · J William Piggott

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.

Quoted 8 lines
$ 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

Quoted 23 lines
---
 man3/tzset.3 | 6 ++++++
 1 file changed, 6 insertions(+)
man3/tzset.3 +6 -0
index a9b088d..9cb9d32 100644
@@ -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.
Signature · 7 lines
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#37 lore raw

PATCH v2 1/1 5/5] tzset.3: TZ filespec omitts the colon

In reply to a message not in the archive

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

---

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/[email protected]: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(-)
man3/tzset.3 +2 -1
index b49c8ee..5c721b6 100644
@@ -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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#39 lore raw

Re: [PATCH[V2] 5/5] tzset.3: TZ filespec omitts the colon

Quoted 9 lines · JWP

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

Quoted 34 lines

---

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/[email protected]: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(-)
man3/tzset.3 +2 -1
index b49c8ee..5c721b6 100644
@@ -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
Signature · 7 lines
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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html