[PATCH v2 09/11] Use clock_gettime to implement gettimeofday.
Joseph Myers
joseph@codesourcery.com
Mon Oct 28 18:01:00 GMT 2019
On Mon, 28 Oct 2019, Lukasz Majewski wrote:
> > attribute_compat_text_section
> > __gettimeofday_tv32 (struct timeval32 *restrict tv32, void *restrict
> > tz) {
> > - struct timeval tv;
> > - __gettimeofday (&tv, tz);
> > + if (__glibc_unlikely (tz != 0))
> > + memset (tz, 0, sizeof (struct timezone));
> >
> > - tv64_to_tv32 (tv32, &tv);
> > + struct timespec ts;
> > + __clock_gettime (CLOCK_REALTIME, &ts);
> > +
> > + ts64_to_tv32 (tv32, &ts);
>
> IMHO, this shall be replaced with valid_* functions from include/time.h
This is dealing with an alpha-specific timeval32 structure; I don't see
how the functions in include/time.h are applicable.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list