+2014-06-13 Meador Inge <meadori@codesourcery.com>
+
+ [BZ #16996]
+ sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Ensure
+ that the cached result has been set before returning it.
+
2014-06-12 Roland McGrath <roland@hack.frob.com>
* nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h: Moved ...
16791, 16796, 16799, 16800, 16815, 16823, 16824, 16831, 16838, 16849,
16854, 16876, 16877, 16878, 16882, 16885, 16888, 16890, 16912, 16915,
16916, 16917, 16922, 16927, 16928, 16932, 16943, 16958, 16965, 16966,
- 16967, 16977, 16978, 16984, 16990, 17009, 17042, 17048.
+ 16967, 16977, 16978, 16984, 16990, 16996, 17009, 17042, 17048.
* The minimum Linux kernel version that this version of the GNU C Library
can be used with is 2.6.32.
int
__get_nprocs (void)
{
- static int cached_result;
+ static int cached_result = -1;
static time_t timestamp;
time_t now = time (NULL);
time_t prev = timestamp;
atomic_read_barrier ();
- if (now == prev)
+ if (now == prev && cached_result > -1)
return cached_result;
/* XXX Here will come a test for the new system call. */