[LTP] [PATCH v2 2/2] pthread_create-14-1: avoid threads sharing stack

Cyril Hrubis chrubis@suse.cz
Mon Dec 11 15:38:50 CET 2017


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.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list