Skip to content

Commit

Permalink
Merge pull request #19 from dkechag/android
Browse files Browse the repository at this point in the history
MCE::Util::get_ncpu for android
  • Loading branch information
marioroy authored Sep 9, 2023
2 parents 84e3a07 + af75044 commit ae5250e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/MCE/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,16 @@ sub get_ncpu {
last OS_CHECK;
};

/android/ && do {
my ( $count, $fh );
if ( open $fh, '<', '/proc/cpuinfo' ) {
$count = grep { /^processor/ } <$fh>;
close $fh;
}
$ncpu = $count if $count;
last OS_CHECK;
};

warn "MCE::Util::get_ncpu: command failed or unknown operating system\n";
}

Expand Down

0 comments on commit ae5250e

Please sign in to comment.