This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH][BZ #16996] get_nprocs: Only return explictly set cache values
- From: Meador Inge <meadori at codesourcery dot com>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 12 Jun 2014 15:22:12 -0500
- Subject: Re: [PATCH][BZ #16996] get_nprocs: Only return explictly set cache values
- Authentication-results: sourceware.org; auth=none
- References: <1402591036-29454-1-git-send-email-meadori at codesourcery dot com> <20140612171519 dot GN10378 at spoyarek dot pnq dot redhat dot com>
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.
CodeSourcery / Mentor Embedded