This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 09/11] Use clock_gettime to implement gettimeofday.
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Lukasz Majewski <lukma at denx dot de>
- Cc: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, <libc-alpha at sourceware dot org>
- Date: Mon, 28 Oct 2019 18:01:45 +0000
- Subject: Re: [PATCH v2 09/11] Use clock_gettime to implement gettimeofday.
- Ironport-sdr: vTgTk0w+HKOqGe+Z6RfbeA7JUlp9fg7fUI9sH9qkWQik4tKpuB2dxMfGyLycYztrD0Equqf3v6 COHllOAYbdTHdUARvuiJ3bUUZCX12/1rJPCjGxccQ+qJ5q5Y11NoSsemL3PcLO8q9LfG5c5Bh8 daPXwbqGymLfGhuY/RFpzLpiv84QVNkqiJOCsHhj/IzFePYoLChc/dxBSfE4wWE8Gr52qsjqLQ RXsdwm15efJqDabLyo8TPT1cppXDkxrtC5FLTDix2uicw0Q/WCyiwGwp/VQQquEx0bC1+vvSRm 198=
- Ironport-sdr: bW7nGe9Zxn53zwoU8x90zz5Npw49AxLWiR0nMRBTSzP/sqUr2BuYrQlSg5CHwMfJujAIZRcTkQ jH3ah3RAcEWEKCilPuW5QFl2D7A8h0/S8lIwLsghRIQSLYgnzg8XgeR1ZSkI0+bIC5uRpRVeO0 bB6nE2IPXMQCUhoMt2s/ufMatcP17LaHEqEDbN81LXDhmGAmq3tPcDqKED5obyAQpgpU7ipRJ3 +X+Iw4tZdrBp5GchkpV9zvrIm8Gta2hMMs2wnP0IujsFIxphvOa0rhg3O/6SGWB3aZUqRQpgfE E2M=
- References: <20191025120832.27667-1-adhemerval.zanella@linaro.org> <20191025120832.27667-10-adhemerval.zanella@linaro.org> <20191028151617.421b7239@jawa>
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