mtr on FreeBSD detects core count for --parallel=auto
This commit is contained in:
parent
32ee6670a5
commit
4911ec1a5b
@ -23,7 +23,7 @@ use File::Path;
|
|||||||
use Carp;
|
use Carp;
|
||||||
|
|
||||||
use base qw(Exporter);
|
use base qw(Exporter);
|
||||||
our @EXPORT= qw(IS_CYGWIN IS_MSYS IS_WINDOWS IS_WIN32PERL IS_AIX IS_MAC
|
our @EXPORT= qw(IS_CYGWIN IS_MSYS IS_WINDOWS IS_WIN32PERL IS_AIX IS_MAC IS_FREEBSD
|
||||||
native_path posix_path mixed_path
|
native_path posix_path mixed_path
|
||||||
check_socket_path_length process_alive open_for_append);
|
check_socket_path_length process_alive open_for_append);
|
||||||
|
|
||||||
@ -79,6 +79,15 @@ BEGIN {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BEGIN {
|
||||||
|
if ($^O eq "freebsd") {
|
||||||
|
eval 'sub IS_FREEBSD { 1 }';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
eval 'sub IS_FREEBSD { 0 }';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# native_path
|
# native_path
|
||||||
# Convert from path format used by perl to the underlying
|
# Convert from path format used by perl to the underlying
|
||||||
|
@ -427,7 +427,7 @@ sub main {
|
|||||||
{
|
{
|
||||||
$opt_parallel= $ENV{NUMBER_OF_PROCESSORS} || 1;
|
$opt_parallel= $ENV{NUMBER_OF_PROCESSORS} || 1;
|
||||||
}
|
}
|
||||||
elsif (IS_MAC)
|
elsif (IS_MAC || IS_FREEBSD)
|
||||||
{
|
{
|
||||||
$opt_parallel= `sysctl -n hw.ncpu`;
|
$opt_parallel= `sysctl -n hw.ncpu`;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user