Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/time Bring in 2020a
details: https://anonhg.NetBSD.org/src/rev/9f89a1bf07d2
branches: trunk
changeset: 933464:9f89a1bf07d2
user: christos <christos%NetBSD.org@localhost>
date: Mon May 25 14:52:48 2020 +0000
description:
Bring in 2020a
diffstat:
lib/libc/time/Makefile | 38 +++++++---
lib/libc/time/NEWS | 157 ++++++++++++++++++++++++++++++++++++++++++++
lib/libc/time/localtime.c | 69 ++++++++++---------
lib/libc/time/private.h | 39 ++++++++--
lib/libc/time/strftime.c | 8 +-
lib/libc/time/theory.html | 100 +++++++++++++++++++++------
lib/libc/time/tz-art.html | 12 +++-
lib/libc/time/tz-link.html | 101 ++++++++++++++++++++++-----
lib/libc/time/tzfile.5 | 5 +-
lib/libc/time/version | 2 +-
lib/libc/time/zdump.8 | 14 +-
lib/libc/time/zdump.c | 10 +-
lib/libc/time/zic.8 | 42 ++++++++++-
lib/libc/time/zic.c | 160 ++++++++++++++++++++++++++++----------------
14 files changed, 574 insertions(+), 183 deletions(-)
diffs (truncated from 1470 to 300 lines):
diff -r c80a70c199c4 -r 9f89a1bf07d2 lib/libc/time/Makefile
--- a/lib/libc/time/Makefile Mon May 25 13:55:31 2020 +0000
+++ b/lib/libc/time/Makefile Mon May 25 14:52:48 2020 +0000
@@ -150,6 +150,15 @@
REDO= posix_right
+# Whether to put an "Expires" line in the leapseconds file.
+# Use EXPIRES_LINE=1 to put the line in, 0 to omit it.
+# The EXPIRES_LINE value matters only if REDO's value contains "right".
+# If you change EXPIRES_LINE, remove the leapseconds file before running "make".
+# zic's support for the Expires line was introduced in tzdb 2020a,
+# and EXPIRES_LINE defaults to 0 for now so that the leapseconds file
+# can be given to older zic implementations.
+EXPIRES_LINE= 0
+
# To install data in text form that has all the information of the TZif data,
# (optionally incorporating leap second information), use
# TZDATA_TEXT= tzdata.zi leapseconds
@@ -295,8 +304,9 @@
# than TM_GMTOFF and TM_ZONE. However, most of them are standardized.
# #
# # To omit or support the external variable "tzname", add one of:
-# # -DHAVE_TZNAME=0
-# # -DHAVE_TZNAME=1
+# # -DHAVE_TZNAME=0 # do not support "tzname"
+# # -DHAVE_TZNAME=1 # support "tzname", which is defined by system library
+# # -DHAVE_TZNAME=2 # support and define "tzname"
# # to the "CFLAGS=" line. "tzname" is required by POSIX 1988 and later.
# # If not defined, the code attempts to guess HAVE_TZNAME from other macros.
# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause
@@ -304,16 +314,20 @@
# # presumably due to memory allocation issues.
# #
# # To omit or support the external variables "timezone" and "daylight", add
-# # -DUSG_COMPAT=0
-# # -DUSG_COMPAT=1
+# # -DUSG_COMPAT=0 # do not support
+# # -DUSG_COMPAT=1 # support, and variables are defined by system library
+# # -DUSG_COMPAT=2 # support and define variables
# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by
# # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later.
# # If not defined, the code attempts to guess USG_COMPAT from other macros.
# #
# # To support the external variable "altzone", add
-# # -DALTZONE
+# # -DALTZONE=0 # do not support
+# # -DALTZONE=1 # support "altzone", which is defined by system library
+# # -DALTZONE=2 # support and define "altzone"
# # to the end of the "CFLAGS=" line; although "altzone" appeared in
# # System V Release 3.1 it has not been standardized.
+# # If not defined, the code attempts to guess ALTZONE from other macros.
#
# If you want functions that were inspired by early versions of X3J11's work,
# add
@@ -321,9 +335,7 @@
# to the end of the "CFLAGS=" line. This arranges for the functions
# "tzsetwall", "offtime", "timelocal", "timegm", "timeoff",
# "posix2time", and "time2posix" to be added to the time conversion library.
-# "tzsetwall" is like "tzset" except that it arranges for local wall clock
-# time (rather than the timezone specified in the TZ environment variable)
-# to be used.
+# "tzsetwall" is deprecated and is intended to be removed soon; see NEWS.
# "offtime" is like "gmtime" except that it accepts a second (long) argument
# that gives an offset to add to the time_t when converting it.
# "timelocal" is equivalent to "mktime".
@@ -333,7 +345,6 @@
# that gives an offset to use when converting to a time_t.
# "posix2time" and "time2posix" are described in an included manual page.
# X3J11's work does not describe any of these functions.
-# Sun has provided "tzsetwall", "timelocal", and "timegm" in SunOS 4.0.
# These functions may well disappear in future releases of the time
# conversion package.
#
@@ -505,11 +516,11 @@
TZCOBJS= zic.o
TZDOBJS= zdump.o localtime.o asctime.o strftime.o
DATEOBJS= date.o localtime.o strftime.o asctime.o
-LIBSRCS= localtime.c asctime.c difftime.c
-LIBOBJS= localtime.o asctime.o difftime.o
+LIBSRCS= localtime.c asctime.c difftime.c strftime.c
+LIBOBJS= localtime.o asctime.o difftime.o strftime.o
HEADERS= tzfile.h private.h
NONLIBSRCS= zic.c zdump.c
-NEWUCBSRCS= date.c strftime.c
+NEWUCBSRCS= date.c
SOURCES= $(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \
tzselect.ksh workman.sh
MANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \
@@ -651,7 +662,8 @@
chmod +x yearistype
leapseconds: $(LEAP_DEPS)
- $(AWK) -f leapseconds.awk leap-seconds.list >$@.out
+ $(AWK) -v EXPIRES_LINE=$(EXPIRES_LINE) \
+ -f leapseconds.awk leap-seconds.list >$@.out
mv $@.out $@
# Arguments to pass to submakes of install_data.
diff -r c80a70c199c4 -r 9f89a1bf07d2 lib/libc/time/NEWS
--- a/lib/libc/time/NEWS Mon May 25 13:55:31 2020 +0000
+++ b/lib/libc/time/NEWS Mon May 25 14:52:48 2020 +0000
@@ -1,5 +1,162 @@
News for the tz database
+Release 2020a - 2020-04-23 16:03:47 -0700
+
+ Briefly:
+ Morocco springs forward on 2020-05-31, not 2020-05-24.
+ Canada's Yukon advanced to -07 year-round on 2020-03-08.
+ America/Nuuk renamed from America/Godthab.
+ zic now supports expiration dates for leap second lists.
+
+ Changes to future timestamps
+
+ Morocco's second spring-forward transition in 2020 will be May 31,
+ not May 24 as predicted earlier. (Thanks to Semlali Naoufal.)
+ Adjust future-year predictions to use the first Sunday after the
+ day after Ramadan, not the first Sunday after Ramadan.
+
+ Canada's Yukon, represented by America/Whitehorse and
+ America/Dawson, advanced to -07 year-round, beginning with its
+ spring-forward transition on 2020-03-08, and will not fall back on
+ 2020-11-01. Although a government press release calls this
+ "permanent Pacific Daylight Saving Time", we prefer MST for
+ consistency with nearby Dawson Creek, Creston, and Fort Nelson.
+ (Thanks to Tim Parenti.)
+
+ Changes to past timestamps
+
+ Shanghai observed DST in 1919. (Thanks to Phake Nick.)
+
+ Changes to timezone identifiers
+
+ To reflect current usage in English better, America/Godthab has
+ been renamed to America/Nuuk. A backwards-compatibility link
+ remains for the old name.
+
+ Changes to code
+
+ localtime.c no longer mishandles timestamps after the last
+ transition in a TZif file with leap seconds and with daylight
+ saving time transitions projected into the indefinite future.
+ For example, with TZ='America/Los_Angeles' with leap seconds,
+ zdump formerly reported a DST transition on 2038-03-14
+ from 01:59:32.999... to 02:59:33 instead of the correct transition
+ from 01:59:59.999... to 03:00:00.
+
+ zic -L now supports an Expires line in the leapseconds file, and
+ truncates the TZif output accordingly. This propagates leap
+ second expiration information into the TZif file, and avoids the
+ abovementioned localtime.c bug as well as similar bugs present in
+ many client implementations. If no Expires line is present, zic
+ -L instead truncates the TZif output based on the #expires comment
+ present in leapseconds files distributed by tzdb 2018f and later;
+ however, this usage is obsolescent. For now, the distributed
+ leapseconds file has an Expires line that is commented out, so
+ that the file can be fed to older versions of zic which ignore the
+ commented-out line. Future tzdb distributions are planned to
+ contain a leapseconds file with an Expires line.
+
+ The configuration macros HAVE_TZNAME and USG_COMPAT should now be
+ set to 1 if the system library supports the feature, and 2 if not.
+ As before, these macros are nonzero if tzcode should support the
+ feature, zero otherwise.
+
+ The configuration macro ALTZONE now has the same values with the
+ same meaning as HAVE_TZNAME and USG_COMPAT.
+
+ The code's defense against CRLF in leap-seconds.list is now
+ portable to POSIX awk. (Problem reported by Deborah Goldsmith.)
+
+ Although the undocumented tzsetwall function is not changed in
+ this release, it is now deprecated in preparation for removal in
+ future releases. Due to POSIX requirements, tzsetwall has not
+ worked for some time. Any code that uses it should instead use
+ tzalloc(NULL) or, if portability trumps thread-safety, should
+ unset the TZ environment variable.
+
+ Changes to commentary
+
+ The Îles-de-la-Madeleine and the Listuguj reserve are noted as
+ following America/Halifax, and comments about Yukon's "south" and
+ "north" have been corrected to say "east" and "west". (Thanks to
+ Jeffery Nichols.)
+
+
+Release 2019c - 2019-09-11 08:59:48 -0700
+
+ Briefly:
+ Fiji observes DST from 2019-11-10 to 2020-01-12.
+ Norfolk Island starts observing Australian-style DST.
+
+ Changes to future timestamps
+
+ Fiji's next DST transitions will be 2019-11-10 and 2020-01-12
+ instead of 2019-11-03 and 2020-01-19. (Thanks to Raymond Kumar.)
+ Adjust future guesses accordingly.
+
+ Norfolk Island will observe Australian-style DST starting in
+ spring 2019. The first transition is on 2019-10-06. (Thanks to
+ Kyle Czech and Michael Deckers.)
+
+ Changes to past timestamps
+
+ Many corrections to time in Turkey from 1940 through 1985.
+ (Thanks to Oya Vulaş via Alois Treindl, and to Kıvanç Yazan.)
+
+ The Norfolk Island 1975-03-02 transition was at 02:00 standard
+ time, not 02:00 DST. (Thanks to Michael Deckers.)
+
+ South Korea observed DST from 1948 through 1951. Although this
+ info was supposed to appear in release 2014j, a typo inadvertently
+ suppressed the change. (Thanks to Alois Treindl.)
+
+ Detroit observed DST in 1967 and 1968 following the US DST rules,
+ except that its 1967 DST began on June 14 at 00:01. (Thanks to
+ Alois Treindl for pointing out that the old data entries were
+ probably wrong.)
+
+ Fix several errors in pre-1970 transitions in Perry County, IN.
+ (Thanks to Alois Triendl for pointing out the 1967/9 errors.)
+
+ Edmonton did not observe DST in 1967 or 1969. In 1946 Vancouver
+ ended DST on 09-29 not 10-13, and Vienna ended DST on 10-07 not
+ 10-06. In 1945 Königsberg (now Kaliningrad) switched from +01/+02
+ to +02/+03 on 04-10 not 01-01, and its +02/+03 is abbreviated
+ EET/EEST, not CET/CEST. (Thanks to Alois Triendl.) In 1946
+ Königsberg switched to +03 on 04-07 not 01-01.
+
+ In 1946 Louisville switched from CST to CDT on 04-28 at 00:01, not
+ 01-01 at 00:00. (Thanks to Alois Treindl and Michael Deckers.)
+ Also, it switched from CST to CDT on 1950-04-30, not 1947-04-27.
+
+ The 1892-05-01 transition in Brussels was at 00:17:30, not at noon.
+ (Thanks to Michael Deckers.)
+
+ Changes to past time zone abbreviations and DST flags
+
+ Hong Kong Winter Time, observed from 1941-10-01 to 1941-12-25,
+ is now flagged as DST and is abbreviated HKWT not HKT.
+
+ Changes to code
+
+ leapseconds.awk now relies only on its input data, rather than
+ also relying on its comments. (Inspired by code from Dennis
+ Ferguson and Chris Woodbury.)
+
+ The code now defends against CRLFs in leap-seconds.list.
+ (Thanks to Brian Inglis and Chris Woodbury.)
+
+ Changes to documentation and commentary
+
+ theory.html discusses leap seconds. (Thanks to Steve Summit.)
+
+ Nashville's newspapers dueled about the time of day in the 1950s.
+ (Thanks to John Seigenthaler.)
+
+ Liechtenstein observed Swiss DST in 1941/2.
+ (Thanks to Alois Treindl.)
+
+
Release 2019b - 2019-07-01 00:09:53 -0700
Briefly:
diff -r c80a70c199c4 -r 9f89a1bf07d2 lib/libc/time/localtime.c
--- a/lib/libc/time/localtime.c Mon May 25 13:55:31 2020 +0000
+++ b/lib/libc/time/localtime.c Mon May 25 14:52:48 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: localtime.c,v 1.122 2019/07/03 15:50:16 christos Exp $ */
+/* $NetBSD: localtime.c,v 1.123 2020/05/25 14:52:48 christos Exp $ */
/* Convert timestamp from time_t to struct tm. */
@@ -12,7 +12,7 @@
#if 0
static char elsieid[] = "@(#)localtime.c 8.17";
#else
-__RCSID("$NetBSD: localtime.c,v 1.122 2019/07/03 15:50:16 christos Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.123 2020/05/25 14:52:48 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -165,6 +165,7 @@
struct tm *);
static bool increment_overflow(int *, int);
static bool increment_overflow_time(time_t *, int_fast32_t);
+static int_fast64_t leapcorr(struct state const *, time_t);
static bool normalize_overflow32(int_fast32_t *, int *, int);
static struct tm *timesub(time_t const *, int_fast32_t, struct state const *,
struct tm *);
@@ -198,7 +199,7 @@
static struct tm tm;
-#if !HAVE_POSIX_DECLS || TZ_TIME_T || defined(__NetBSD__)
+#if 2 <= HAVE_TZNAME + TZ_TIME_T || defined(__NetBSD__)
# if !defined(__LIBC12_SOURCE__)
__aconst char * tzname[2] = {
Home |
Main Index |
Thread Index |
Old Index