mbox series

[0/4] mktime tm_isdst compatibility improvements

Message ID cover.1727784647.git.fweimer@redhat.com
Headers show
Series mktime tm_isdst compatibility improvements | expand

Message

Florian Weimer Oct. 1, 2024, 12:14 p.m. UTC
This series fixes some divergence with historic mktime behavior
(particularly for UTC) and adds a tunable to disable DST adjustment
heuristics.  I also try to explain the tm_isdst handling in greater
detail in the manual.

Tested on i686-linux-gnu and x86_64-linux-gnu.

Thanks,
Florian

Florian Weimer (4):
  time: Use a flag for localtime/gmtime operation in __mktime_internal
  time: Push tzset lock into callers of time functions
  time: Do not perform forced DST adjustment for DST-less zones
  time: Implement the glibc.time.mktime_dst_adjustment tunable

 elf/dl-tunables.list           |   9 ++
 elf/libc_early_init.c          |   3 +
 include/time.h                 |  23 -----
 manual/time.texi               |  42 ++++++++-
 manual/tunables.texi           |  12 +++
 time/Makefile                  |   8 +-
 time/gmtime.c                  |   8 +-
 time/localtime.c               |   8 +-
 time/mktime-internal.h         |  11 +--
 time/mktime.c                  | 117 ++++++++++++++++---------
 time/strftime_l.c              |   1 +
 time/time-tunables.c           |  29 ++++++
 time/timegm.c                  |  13 ++-
 time/tst-mktime-dst-adjust-0.c | 154 ++++++++++++++++++++++++++++++++
 time/tst-mktime-dst-adjust-1.c |   2 +
 time/tst-mktime-dst-adjust.c   | 156 +++++++++++++++++++++++++++++++++
 time/tzfile.c                  |   1 +
 time/tzset.c                   |  20 +++--
 time/tzset.h                   |  40 +++++++++
 timezone/testdata/IST          | Bin 0 -> 285 bytes
 20 files changed, 569 insertions(+), 88 deletions(-)
 create mode 100644 time/time-tunables.c
 create mode 100644 time/tst-mktime-dst-adjust-0.c
 create mode 100644 time/tst-mktime-dst-adjust-1.c
 create mode 100644 time/tst-mktime-dst-adjust.c
 create mode 100644 time/tzset.h
 create mode 100644 timezone/testdata/IST


base-commit: 9dfea3de7f690bff70e3c6eb346b9ad082bb2e35