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.


Hi Joseph,

> 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; 

Maybe I did not noticed it earlier.

The tv32-compat.h defines [1]:
struct timeval32
{
  int32_t tv_sec;
  int32_t tv_usec;
};

and conversion functions - like ts64_to_tv32() are to handle this
specific type.

I do think that if struct timeval32 is alpha specific, then the
conversion functions shall be kept.

> I don't
> see how the functions in include/time.h are applicable.
> 

Ok.

Note:
[1] - https://patchwork.ozlabs.org/patch/1184084/


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

Attachment: pgp_DyiOxVNhL.pgp
Description: OpenPGP digital signature


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