This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v9] y2038: Provide conversion helpers for struct __timespec64

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]