diff options
author | Florian Weimer <fweimer@redhat.com> | 2017-07-04 16:12:46 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2017-07-04 16:12:46 +0200 |
commit | 1ff6c67a252e59488a26e3c8f6690b29ef56e369 (patch) | |
tree | a5a31bb7cad61d767fc65db9abfceba4c252946c /sysdeps/unix | |
parent | 4446a885f3aeb3a33b95c72bae1f115bed77f0cb (diff) | |
download | glibc-1ff6c67a252e59488a26e3c8f6690b29ef56e369.tar.gz glibc-1ff6c67a252e59488a26e3c8f6690b29ef56e369.tar.xz glibc-1ff6c67a252e59488a26e3c8f6690b29ef56e369.zip |
sysconf: Use conservative default for _SC_NPROCESSORS_ONLN [BZ #21542]
Diffstat (limited to 'sysdeps/unix')
-rw-r--r-- | sysdeps/unix/sysv/linux/getsysstats.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c index 63e41100eb..a0dd6ebe93 100644 --- a/sysdeps/unix/sysv/linux/getsysstats.c +++ b/sysdeps/unix/sysv/linux/getsysstats.c @@ -188,7 +188,10 @@ __get_nprocs (void) cp = buffer_end; re = buffer_end; - result = 1; + + /* Default to an SMP system in case we cannot obtain an accurate + number. */ + result = 2; /* The /proc/stat format is more uniform, use it by default. */ fd = open_not_cancel_2 ("/proc/stat", flags); |