[PATCH][BZ #16996] get_nprocs: Only return explictly set cache values

Meador Inge meadori@codesourcery.com
Thu Jun 12 20:22:00 GMT 2014


On 06/12/2014 12:15 PM, Siddhesh Poyarekar wrote:

> Wouldn't (now == prev && now > 0) be nicer?

Hmmm, good point, but is it OK to make assumptions about the underlying
representation of 'time_t'* (e.g. that we get the expected behavior from the > 0
compare)?  The 'now == prev' compare is at least 'time_t'-to-'time_t'.  I
thought about just doing 'cached_result > 0' too, but I suppose 'cached_result'
can actually be 0 in the case of an error.

* The C Standard generally says not to, but maybe we can make that assumption
within the implementation of the C Standard Library.

-- 
Meador Inge
CodeSourcery / Mentor Embedded



More information about the Libc-alpha mailing list