public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: libc-alpha@sourceware.org
Cc: Paul Eggert <eggert@cs.ucla.edu>,
	Albert ARIBAUD <albert.aribaud@3adev.fr>
Subject: Re: Second draft of the Y2038 design document
Date: Thu, 28 Jan 2016 23:21:00 -0000	[thread overview]
Message-ID: <1683528.yWvM1WbPg0@wuerfel> (raw)
In-Reply-To: <56AA8465.5040803@cs.ucla.edu>

On Thursday 28 January 2016 13:13:09 Paul Eggert wrote:
> Some typos: "1901-12-13 19:55:13 UTC" should be "1901-12-13 20:45:52 
> UTC". "sentive" should be "sensitive". "20338" should be "2038". "Thins" 
> should be "This".
> 
> I don't see why functions like 'time' and 'gettimeofday' should be 
> allowed to misbehave on 64-bit hosts after 2038. They should just work. 
> Glibc should not worry about 64-bit kernels without 64-bit time support. 
> Any such kernels should just get fixed before 2038 rolls around.
> 
> Why are struct rusage, getrusage, etc. Y2038-sensitive? They hold 
> intervals, not absolute times.

It can theoretically still overflow, though not at the same time:
If you have a large NUMA system with thousands of CPUs and an HPC
workload running on all of them for a couple of months at a time,
the field will overflow.

getrusage is also an example of a class of interfaces that need to
be addressed in one way or another because they contain a time_t
member in a structure, so any user space program that sees the
current definition of struct rusage but uses a 64-bit time_t will
disagree on the layout with the old kernel system call. Other
interfaces in this class are clock_getres, pselect, ppoll,
io_getevents, recvmmsg, semtimedop, rt_sigtimedwait,
sched_rr_get_interval, and sysinfo, along with many ioctl commands.
There is no overflow in them, but we have to either add a
replacement interface, or redefine the API to pass a 'long' instead
of 'time_t' to keep binary compatibility.

My current patch set for the kernel syscalls uses a structure
with all 64-bit members, so we can share the implementation between
the new 32-bit system call in compat mode with the existing native
64-bit system call. I'm not particularly attached to that solution,
it's just one of multiple ways to do this and I had to pick one.

	Arnd

  reply	other threads:[~2016-01-28 23:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28 19:41 Albert ARIBAUD
2016-01-28 21:13 ` Paul Eggert
2016-01-28 23:21   ` Arnd Bergmann [this message]
2016-01-29  0:12     ` Paul Eggert
2016-01-29  8:58       ` Arnd Bergmann
2016-03-20  8:07         ` Albert ARIBAUD
2016-03-21 12:15   ` Albert ARIBAUD
2016-03-21 13:07     ` Arnd Bergmann
2016-03-21 18:19     ` Paul Eggert
2016-03-25 12:24       ` Albert ARIBAUD
2016-01-28 21:14 ` Joseph Myers
2016-01-28 23:30   ` Arnd Bergmann
2016-01-28 23:36     ` Joseph Myers
2016-01-28 23:55 ` Arnd Bergmann
2016-01-29 15:40   ` Joseph Myers
2016-01-29 16:27     ` Arnd Bergmann

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=1683528.yWvM1WbPg0@wuerfel \
    --to=arnd@arndb.de \
    --cc=albert.aribaud@3adev.fr \
    --cc=eggert@cs.ucla.edu \
    --cc=libc-alpha@sourceware.org \
    /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).