[LTP] [PATCH v2 2/2] pthread_create-14-1: avoid threads sharing stack
Jan Stancek
jstancek@redhat.com
Tue Dec 12 10:26:05 CET 2017
----- Original Message -----
> Hi!
> > +static unsigned long current_time_usec(void)
> > +{
> > + struct timeval now;
> > +
> > + SAFE_FUNC(gettimeofday(&now, NULL));
> > + return now.tv_sec * 1000000 + now.tv_usec;
> > +}
>
> Looking into this closely wouldn't this overflow on 32bit where
> sizeof(long) == 4 ?
>
> So this functions has to return long long which should be 64 bit even on
> 32bit archs.
>
> Sorry for not catching that in the first review.
>
>
> Acked with fix fix for the overflow.
Pushed with long long. I did same change to pthread_detach-4-3,
where I made the same mistake years ago.
I'm thinking if we could re-use include/tst_timer.h in open_posix tests.
Regards,
Jan
More information about the ltp
mailing list