unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [RFC 00/12] [RFC] y2038: Convert timespec_{sub|add|create} in support to be Y2038 safe
@ 2020-06-01 14:07 Lukasz Majewski
  2020-06-01 14:07 ` [RFC 01/12] doc: Fix wording and formattine in ./support/README Lukasz Majewski
                   ` (13 more replies)
  0 siblings, 14 replies; 24+ messages in thread
From: Lukasz Majewski @ 2020-06-01 14:07 UTC (permalink / raw)
  To: Joseph Myers, Paul Eggert, Adhemerval Zanella
  Cc: Florian Weimer, GNU C Library, Andreas Schwab, Alistair Francis

This patch set is the first attempt to convert functions utilized by nptl and
pthreads to support 64 bit time.

First timespec* functions are renamed to have common "__" prefix for internal
functions. This is a preparatory work for further conversion.

One question with this patch set is how shall we tackle the conversion
of time related functions (like e.g. ./support/timespec_add) used internally in
glibc as helper functions for internal code or tests.
I could follow the approach used for glibc syscalls (like clock_settime) to have
two versions depending on __TIMESIZE and __WORDSIZE, but this seems to be an
overkill for internally used functions.

Patches with "Convert:" prefix replace struct timespec with struct __timespec64
in timespec_* functions. This is necessary to have in-glibc proper support for
64 bit time.
The problem is with instant replacement of struct timespec with struct 
__timespec64 in glibc internal code (and tests). 

For replacing timesize with __timesize64 I could:
- Replace its occurences in relevant directories - like ./nptl or
  ./sysdeps/pthreads

- Replace them in functions (tests) and use explicit conversion functions - like
  valid_timespec_to_timespec64()

- Replace _all_ occurences of struct timespec with struct __timespec64 at once
  with using sed on glibc tree.

The last option seems to be the most appealing as we already use __timespec64
(with its aliassing) for some core system syscalls (like clock_gettime).
However, such patch shall be applied just after the release of new stable
version to have time for potential fixes.

Lukasz Majewski (12):
  doc: Fix wording and formattine in ./support/README
  y2038: Rename timespec_compare to __timespec_compare
  y2038: Rename make_timespec to __make_timespec
  y2038: Rename xclock_gettime to __xclock_gettime
  y2038: Rename xclock_now to __xclock_now
  y2038: Rename timespec_sub to __timespec_sub
  y2038: Rename timespec_add to __timespec_add
  y2038: Convert __make_timespec to be Y2038 safe
  y2038: Convert __xclock_gettime to be Y2038 safe
  y2038: Convert __xclock_now to be Y2038 safe
  y2038: Convert timespec* files in ./support to be Y2038 safe
  y2038: Convert timespec_* from posix-timer.h to be Y2038 safe

 nptl/tst-eintr2.c                |  4 ++--
 nptl/tst-eintr5.c                |  4 ++--
 nptl/tst-rwlock6.c               | 14 +++++++-------
 nptl/tst-rwlock7.c               | 10 +++++-----
 nptl/tst-rwlock9.c               | 10 +++++-----
 nptl/tst-sem17.c                 |  2 +-
 nptl/tst-sem5.c                  |  4 ++--
 support/README                   |  4 ++--
 support/timespec-add.c           | 12 ++++++------
 support/timespec-sub.c           | 18 +++++++++---------
 support/timespec.c               | 12 ++++++------
 support/timespec.h               | 27 ++++++++++++++-------------
 support/xclock_gettime.c         |  5 ++---
 support/xtime.h                  |  9 +++++----
 sysdeps/mach/clock_nanosleep.c   |  4 ++--
 sysdeps/pthread/posix-timer.h    | 11 ++++++-----
 sysdeps/pthread/timer_gettime.c  |  4 ++--
 sysdeps/pthread/timer_routines.c | 14 +++++++-------
 sysdeps/pthread/timer_settime.c  |  4 ++--
 sysdeps/pthread/tst-cond11.c     |  2 +-
 sysdeps/pthread/tst-cond26.c     |  2 +-
 sysdeps/pthread/tst-cond27.c     |  4 ++--
 sysdeps/pthread/tst-join14.c     |  2 +-
 sysdeps/pthread/tst-join3.c      |  8 ++++----
 sysdeps/pthread/tst-join5.c      | 12 ++++++------
 sysdeps/pthread/tst-mutex5.c     | 12 ++++++------
 sysdeps/pthread/tst-mutex9.c     |  4 ++--
 sysdeps/pthread/tst-rwlock14.c   |  2 +-
 28 files changed, 111 insertions(+), 109 deletions(-)

-- 
2.20.1


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

end of thread, other threads:[~2020-06-24 22:10 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-01 14:07 [RFC 00/12] [RFC] y2038: Convert timespec_{sub|add|create} in support to be Y2038 safe Lukasz Majewski
2020-06-01 14:07 ` [RFC 01/12] doc: Fix wording and formattine in ./support/README Lukasz Majewski
2020-06-01 14:07 ` [RFC 02/12] y2038: Rename timespec_compare to __timespec_compare Lukasz Majewski
2020-06-01 14:07 ` [RFC 03/12] y2038: Rename make_timespec to __make_timespec Lukasz Majewski
2020-06-01 14:07 ` [RFC 04/12] y2038: Rename xclock_gettime to __xclock_gettime Lukasz Majewski
2020-06-01 14:07 ` [RFC 05/12] y2038: Rename xclock_now to __xclock_now Lukasz Majewski
2020-06-01 14:07 ` [RFC 06/12] y2038: Rename timespec_sub to __timespec_sub Lukasz Majewski
2020-06-01 14:07 ` [RFC 07/12] y2038: Rename timespec_add to __timespec_add Lukasz Majewski
2020-06-01 14:07 ` [RFC 08/12] y2038: Convert __make_timespec to be Y2038 safe Lukasz Majewski
2020-06-01 14:07 ` [RFC 09/12] y2038: Convert __xclock_gettime " Lukasz Majewski
2020-06-01 14:07 ` [RFC 10/12] y2038: Convert __xclock_now " Lukasz Majewski
2020-06-01 14:07 ` [RFC 11/12] y2038: Convert timespec* files in ./support " Lukasz Majewski
2020-06-01 14:07 ` [RFC 12/12] y2038: Convert timespec_* from posix-timer.h " Lukasz Majewski
2020-06-02 18:05 ` [RFC 00/12] [RFC] y2038: Convert timespec_{sub|add|create} in support " Joseph Myers
2020-06-03 11:42   ` Lukasz Majewski
2020-06-03 12:53 ` [Y2038] Replacement of struct timespec with struct __timespec64 in glibc internal code Lukasz Majewski
2020-06-03 17:28   ` Joseph Myers
2020-06-03 20:45     ` Lukasz Majewski
2020-06-24 12:26     ` Lukasz Majewski
2020-06-24 12:43       ` Andreas Schwab
2020-06-24 20:39         ` Lukasz Majewski
2020-06-24 22:10           ` Joseph Myers
2020-06-24 17:43       ` Joseph Myers
2020-06-08 22:23   ` Samuel Thibault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).