This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 02/17] y2038: Remove newstat family from default syscall set
- From: Arnd Bergmann <arnd at arndb dot de>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Christoph Hellwig <hch at infradead dot org>, Thomas Gleixner <tglx at linutronix dot de>, y2038 Mailman List <y2038 at lists dot linaro dot org>, Linux API <linux-api at vger dot kernel dot org>, linux-arch <linux-arch at vger dot kernel dot org>, GNU C Library <libc-alpha at sourceware dot org>, Albert ARIBAUD <albert dot aribaud at 3adev dot fr>, Networking <netdev at vger dot kernel dot org>, Al Viro <viro at zeniv dot linux dot org dot uk>, Peter Zijlstra <peterz at infradead dot org>, Darren Hart <dvhart at infradead dot org>, "Eric W . Biederman" <ebiederm at xmission dot com>, Dominik Brodowski <linux at dominikbrodowski dot net>
- Date: Thu, 19 Jul 2018 10:53:24 +0200
- Subject: Re: [PATCH v2 02/17] y2038: Remove newstat family from default syscall set
- References: <20180716161103.16239-1-arnd@arndb.de> <20180716161103.16239-3-arnd@arndb.de> <20180717125039.GB25416@infradead.org> <CAK8P3a3a8Fyi3e24CE=SPmdEKskEjeDr9YZte7DU_jT2svF3Uw@mail.gmail.com> <alpine.DEB.2.20.1807182010290.7221@digraph.polyomino.org.uk>
On Wed, Jul 18, 2018 at 10:15 PM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Tue, 17 Jul 2018, Arnd Bergmann wrote:
>
>> That would definitely help. See below for the stat implementation
>> I did in my musl libc prototype based on statx(). It passes the
>> LTP syscall tests, but that doesn't mean all the corner cases
>> are correct.
>
> Well, you definitely need explicit timestamp conversions on the result of
> statx to be usable in struct stat when userspace "long" is 64-bit, for BE
> because otherwise the integer nanoseconds will be in the wrong place for
> struct timespec, and for LE if the "__reserved is held in case we need a
> yet finer resolution." might start being returned as nonzero (for integer
> attoseconds, I suppose) in future.
Right. The musl implementation I sent did that by simply copying each
field we care about from the statx structure into the stat structure
individually. This is the more or less the same thing that the kernel
does to implement stat() as well.
Arnd