1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00

SMP: Use nproc(1) instead of sysctl kern.smp.cpus

The former respects cpuset, while the latter does not.

$ cpuset -l 1 -- make -V MAKE_JOBS_NUMBER
1

As nproc is newly introduced, keep the previous variant as a fallback
for the time being.

Differential Revision:	https://reviews.freebsd.org/D38457
This commit is contained in:
Mateusz Guzik 2023-02-16 16:49:53 +01:00 committed by Baptiste Daroussin
parent 22885407b3
commit e3a17d6ec3
2 changed files with 2 additions and 1 deletions

View File

@ -64,6 +64,7 @@ MOUNT_DEVFS?= ${MOUNT} -t devfs devfs
# a make target
MOUNT_NULLFS?= /sbin/mount_nullfs
MV?= /bin/mv
NPROC?= /bin/nproc
OBJCOPY?= /usr/bin/objcopy
OBJDUMP?= /usr/bin/objdump
PASTE?= /usr/bin/paste

View File

@ -2041,7 +2041,7 @@ MAKE_JOBS_NUMBER= 1
_MAKE_JOBS_NUMBER:= ${MAKE_JOBS_NUMBER}
. else
. if !defined(_SMP_CPUS)
_SMP_CPUS!= ${SYSCTL} -n kern.smp.cpus
_SMP_CPUS!= ${NPROC} 2>/dev/null || ${SYSCTL} -n kern.smp.cpus
. endif
_EXPORTED_VARS+= _SMP_CPUS
_MAKE_JOBS_NUMBER= ${_SMP_CPUS}