1
# DP: boehm-gc/pthread_support.c (GC_get_nprocs): Use sysconf as fallback.
4
boehm-gc/pthread_support.c | 3 ++-
5
1 files changed, 2 insertions(+), 1 deletions(-)
7
Index: b/src/boehm-gc/pthread_support.c
8
===================================================================
9
--- a/src/boehm-gc/pthread_support.c
10
+++ b/src/boehm-gc/pthread_support.c
11
@@ -724,7 +724,8 @@ int GC_get_nprocs()
12
f = open("/proc/stat", O_RDONLY);
13
if (f < 0 || (len = STAT_READ(f, stat_buf, STAT_BUF_SIZE)) < 100) {
14
WARN("Couldn't read /proc/stat\n", 0);
16
+ /* Fallback to sysconf after the warning */
17
+ return sysconf(_SC_NPROCESSORS_ONLN);
19
for (i = 0; i < len - 100; ++i) {
20
if (stat_buf[i] == '\n' && stat_buf[i+1] == 'c'