public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: Joseph Myers <joseph@codesourcery.com>,
	Paul Eggert <eggert@cs.ucla.edu>,
	Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: Alistair Francis <alistair23@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	GNU C Library <libc-alpha@sourceware.org>,
	Siddhesh Poyarekar <siddhesh@gotplt.org>,
	Florian Weimer <fweimer@redhat.com>,
	Zack Weinberg <zackw@panix.com>,
	Carlos O'Donell <carlos@redhat.com>,
	Andreas Schwab <schwab@suse.de>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	libc-help@sourceware.org
Subject: [Y2038] Replacement of struct timespec with struct __timespec64 in glibc internal code
Date: Wed, 3 Jun 2020 14:53:47 +0200	[thread overview]
Message-ID: <20200603145347.4025892b@jawa> (raw)
In-Reply-To: <20200601140740.16371-1-lukma@denx.de>

[-- Attachment #1: Type: text/plain, Size: 2286 bytes --]

Dear Community,

I would like to bring up one relevant Y2038 support issue  - to be more
specific - the conversion/replacement of struct timespec to struct
__timespec64 in glibc internal code (source tree).

For example - I would like to convert nptl and pthreads to be Y2038
safe. To do that the timespec_* helpers and some functions, which use
futex_time64 syscall, (from 5.1+) need to use struct __timespec64. 

The problem is with instant replacement of struct timespec with
struct __timespec64 in glibc internal code (and tests). 


To do it I could:
- Replace its occurences in relevant directories - like ./nptl or
  ./sysdeps/pthread - i.e. rename all occurrences in a single directory
 
- Replace them in functions (tests) and use explicit conversion
  functions - like valid_timespec_to_timespec64() before passing struct
  __timespec64 arguments (like ones for futex_time64 for nptl).

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

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


Which options shall we use?



A few more related questions:
- Shall tests in ./nptl and ./sysdeps/pthread [*] use struct
  __timespec64 or struct timespec? 
  From my understanding tests (like ./nptl/tst-*) use exported headers
  so struct timespec for them is struct __timespec64 anyway for archs
  with __WORDSIZE == 32 and __TIMESIZE !=64.

- Other time related structures needs to be converted as well - like
  struct itimerspec. 


[*] - from running scripts/build-many-glibcs.py it looks like only
i686-gnu port (HURD) is using code in ./sysdeps/pthread. Will
./sysdeps/pthread be replaced by nptl in some near time in the future
(and removed)? 



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2020-06-03 12:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Lukasz Majewski [this message]
2020-06-03 17:28   ` [Y2038] Replacement of struct timespec with struct __timespec64 in glibc internal code 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200603145347.4025892b@jawa \
    --to=lukma@denx.de \
    --cc=adhemerval.zanella@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=alistair23@gmail.com \
    --cc=carlos@redhat.com \
    --cc=eggert@cs.ucla.edu \
    --cc=fweimer@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=libc-help@sourceware.org \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=schwab@suse.de \
    --cc=siddhesh@gotplt.org \
    --cc=zackw@panix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).