[PATCH v8 2/3] y2038: Provide conversion helpers for struct __timespec64

Joseph Myers joseph@codesourcery.com
Thu Sep 19 20:17:00 GMT 2019


On Wed, 18 Sep 2019, Lukasz Majewski wrote:

> +/* Convert a known valid struct __timespec64 into a struct timespec.  */

It's not just "valid", it's valid *and within range of struct timespec*.  
(That is, I think the comment needs to be expanded.)

> +/* Convert a known valid struct __timespec64 into a struct timeval.  */

Likewise.

> +/* Check and convert a struct timespec into a struct __timespec64.  */
> +static inline bool
> +timespec_to_timespec64 (const struct timespec *ts32,
> +                        struct __timespec64 *ts64)

The comment on the function needs to say what the return value means.

> +/* Check and convert a struct __timespec64 into a struct timespec.  */
> +static inline bool
> +timespec64_to_timespec (const struct __timespec64 *ts64,
> +                        struct timespec *ts32)

Likewise.

> +/* Check and convert a struct __timespec64 into a struct timeval.  */
> +static inline bool
> +timespec64_to_timeval (const struct __timespec64 *ts64,
> +                       struct timeval *tv32)

Likewise.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list