From da83cd31bebb3ad6dd8af3d05f0c93caf37a2187 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 6 Oct 2011 17:13:29 +0200 Subject: [PATCH] In bisect-runner.pl, if getconf exists, use it to report the number of CPUs. Thanks to David Leadbeater for the suggestion. --- Porting/bisect-runner.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Porting/bisect-runner.pl b/Porting/bisect-runner.pl index 232cdc7..22137ab 100755 --- a/Porting/bisect-runner.pl +++ b/Porting/bisect-runner.pl @@ -15,6 +15,8 @@ if (open my $fh, '<', '/proc/cpuinfo') { } } elsif (-x '/sbin/sysctl') { $cpus = 1 + $1 if `/sbin/sysctl hw.ncpu` =~ /^hw\.ncpu: (\d+)$/; +} elsif (-x '/usr/bin/getconf') { + $cpus = 1 + $1 if `/usr/bin/getconf _NPROCESSORS_ONLN` =~ /^(\d+)$/; } my %options = @@ -269,9 +271,10 @@ previous settings for the same parameter. -j I -Number of C jobs to run in parallel. If F exists and can -be parsed, or F exists and reports C, defaults to -1 + I. Otherwise defaults to 2. +Number of C jobs to run in parallel. If F exists and +can be parsed, or F exists and reports C, or +F exists and reports C<_NPROCESSORS_ONLN> defaults to 1 + +I. Otherwise defaults to 2. =item * -- 1.8.3.1