This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [Y2038] Fifth draft of the Y2038 design document
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Albert ARIBAUD <albert dot aribaud at 3adev dot fr>, Arnd Bergmann <arnd at arndb dot de>
- Cc: Joseph Myers <joseph at codesourcery dot com>, y2038 at lists dot linaro dot org, GNU C Library <libc-alpha at sourceware dot org>, Deepa Dinamani <deepa dot kernel at gmail dot com>
- Date: Wed, 8 Mar 2017 10:26:54 -0800
- Subject: Re: [Y2038] Fifth draft of the Y2038 design document
- Authentication-results: sourceware.org; auth=none
- References: <20170222090511.48be22ed.albert.aribaud@3adev.fr> <CAK8P3a2-vsreq0WFiTS-WizSvmci_C5f4pMAiYF7-OhjzQZiNg@mail.gmail.com> <alpine.DEB.2.20.1702222305450.24643@digraph.polyomino.org.uk> <CAK8P3a2nioXeVy+LnAz9wOObTQuD2kfJHUW-eb4=-tcohs43sQ@mail.gmail.com> <alpine.DEB.2.20.1702231726150.30491@digraph.polyomino.org.uk> <CAK8P3a3fFZBx-h=33an45dLVUqEq1eL9Gzu2zTRKQoZLSYKkzQ@mail.gmail.com> <20170227120204.5846d883.albert.aribaud@3adev.fr> <CAK8P3a07bk9j27kxbmtY=hZ=gffAOktsk91Gmo0YDq5DCdcBtw@mail.gmail.com> <alpine.DEB.2.20.1702271841060.12140@digraph.polyomino.org.uk> <CAK8P3a3vHecifoU_q17Xae2Pc8fu3qUOe9FH+HTKL17MhXU=Ag@mail.gmail.com> <20170227210620.3a8af1ce.albert.aribaud@3adev.fr> <CAK8P3a3sFdFVutFd=4JvP30QQDpOFPzE-1NeRnLJxk83MPispA@mail.gmail.com> <20170308112845.2dd88d86.albert.aribaud@3adev.fr>
On 03/08/2017 02:28 AM, Albert ARIBAUD wrote:
the only problem I see is if
some weird code implicitly depends on tv_nsec's size being 'long'.
Although I have not found "weird code" like that in GNU applications I
help maintain, I did find one instance of "weird code" back in 2012 when
I was first looking into the problem: an example program in Kerrisk's
book "The Linux Programming Interface"
<http://man7.org/tlpi/code/online/dist/timers/t_clock_nanosleep.c.html>,
which contains this:
printf("... Remaining: %ld.%09ld",
(long) remain.tv_sec, remain.tv_nsec);
This fails on ABIs where tv_nsec is 'long long' and where 'long long' is passed differently from 'long'. (The code also fails on these ABIs if remain.tv_sec exceeds LONG_MAX, of course.)
So, although I'm mildly inclined to think it's OK to change tv_nsec to be wider than long, I suspect this change will break a few lower-quality applications in minor ways, and this is not a cost that we can entirely sweep under the rug.