when --all fails for any reason, I think we should try with the number of available processing units, at least it is a more accurate value than return 1 (and document this behaviour).
Bruno, Jim, what do you think? Cheers, Giuseppe "Dmitry V. Levin" <[email protected]> writes: > Hi, > > The recently introduced nproc utility outputs wrong result when run in > --all mode inside a /proc-less /sys-less GNU/Linux chroot on a system > with several CPUs. In this environment, "nproc --all" always outputs 1 > while plain "nproc" outputs correct number of available CPUs. > The underlying num_processors() function from gnulib relies on > sysconf (_SC_NPROCESSORS_CONF) which always return 1 when neither /sys > nor /proc is mounted. > > I'm not sure whether this limitation is unavoidable (and have to be > documented) or it should be treated as a bug. In the first case, > tests/misc/nproc-avail also needs to be adjusted to call skip_test_ > when the OS is GNU/Linux and neither /sys nor /proc is mounted.
