This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v9] y2038: Provide conversion helpers for struct __timespec64
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Lukasz Majewski <lukma at denx dot de>
- Cc: Alistair Francis <alistair23 at gmail dot com>, Alistair Francis <alistair dot francis at wdc dot com>, Florian Weimer <fw at deneb dot enyo dot de>, Zack Weinberg <zackw at panix dot com>, Arnd Bergmann <arnd at arndb dot de>, GNU C Library <libc-alpha at sourceware dot org>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Florian Weimer <fweimer at redhat dot com>, Carlos O'Donell <carlos at redhat dot com>, Stepan Golosunov <stepan at golosunov dot pp dot ru>
- Date: Thu, 26 Sep 2019 23:14:10 +0000
- Subject: Re: [PATCH v9] y2038: Provide conversion helpers for struct __timespec64
- Ironport-sdr: QmtoOBuZXJgcfCDvDfN7C34Rw9WuDOKQaau43MSRtMT3GXRJOpN9iDb0e+FjRLtJbdB2GOKVzI 0dtnkw7i2nK/wGfn51s1eWjOjYBuEq0kC4I4F9F/fwitFs0hNU7V1iNfokzLxPSBNaJ76b4jbe oj4bGYydFfw115EBlQqxKf2lH9BXuZh+aWL2Hra4scvgZwcVQe8mN0Kzpf7iAGWl66Xdt7+jDt AqxLE40z0r3khNrIqNKNgSlE7PLmLbG60w8GWL1Mh4+SzexrFZcjJ8gxUwto8cIXvsCbXTlNAa RoU=
- Ironport-sdr: 4jOzfFHDPNQZWfTNOZWAFLSCy84QOJX7mK1HSiwFGAkNviCceGD0ja7YVbxnWnIKzYiTzbJjfA pUxGg4XFhwQe66jeUVWeY7DIrnE/flEuqn4S9DoxM21GJgtdn7IbgfYzlJEOIztdYpvWJwI7jj T++HgKtF3pjExyKp1AhJGGqQRZeYTQWHpbR0Onan8kcRpt2Ip9x2IgSYlTWyZMelbkMWJzKP4h yRRV88VIiPe4l3LsHOGe8w2KIJdgY2JktxCWfAMUeMMsQ3Y6s92tcGhTkg8ztjhnwOXl9a7NGv W2o=
- References: <20190926215547.14522-1-lukma@denx.de> <alpine.DEB.2.21.1909262216100.14912@digraph.polyomino.org.uk> <20190927004322.599c1aed@jawa>
On Fri, 27 Sep 2019, Lukasz Majewski wrote:
> > OK, though we'll need to watch users of these interfaces carefully to
> > see if timespec64_to_timespec and timespec64_to_timeval are the best
> > interfaces for the contexts in which they are used. (The issue is
> > that they return false in two different cases, invalid nanoseconds
> > which would typically be an EINVAL error and out-of-range seconds
> > which would be EOVERFLOW. So in any case where the caller needs to
> > distinguish those conditions to determine what value to use for
> > errno, it would need to repeat one of the checks from those
> > functions. But maybe the compiler could optimize the code generated
> > so it doesn't actually end up with a duplicate of the nanoseconds
> > range test.)
> >
>
> So then maybe it would be more natural and practical to just return the
> error code when the proper error condition is detected (so the return
> would be int instead of bool)?
Or remove these functions until we actually have a followup patch using
them (the __clock_settime64 patch doesn't use them), as it will be easier
to judge the best API in the context of patches using it.
--
Joseph S. Myers
joseph@codesourcery.com