This is the mail archive of the libc-alpha@sourceware.org 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 v2 09/11] Use clock_gettime to implement gettimeofday.


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


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