[PATCH] build-all: Simplify determination of number of CPUs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use 'getconf _NPROCESSORS_ONLN' to determine the total number
of available ("online") CPUs.

I have seen this 1st in some build-scripts of Grml project and
had some discussions with Thorsten Glaser on this topic.

Signed-off-by: Sedat Dilek <sedat.dilek@xxxxxxxxx>
---
 build-all | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/build-all b/build-all
index 9d2959e..50b3d45 100755
--- a/build-all
+++ b/build-all
@@ -6,8 +6,7 @@ else
 	. config
 fi
 
-nr_cpus=$(expr 1 + $(grep ^processor /proc/cpuinfo | tail -1 | \
-		sed -e 's/.*://') )
+nr_cpus=$(getconf _NPROCESSORS_ONLN)
 J=-j$(expr $nr_cpus \* 2)
 
 DESTDIR=$(pwd)/bld
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux