diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2023-02-15 20:17:27 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2023-02-15 20:43:46 +0000 |
commit | 059320b8c8de73a90514879cd1e2da397584cfde (patch) | |
tree | b751bb7cac1cf6b90993312b55071b94d36db42f /bin/nproc | |
parent | 5dd48f718433959c283a8a4d6e46512426f1e200 (diff) | |
download | src-059320b8c8de73a90514879cd1e2da397584cfde.tar.gz src-059320b8c8de73a90514879cd1e2da397584cfde.zip |
Diffstat (limited to 'bin/nproc')
-rw-r--r-- | bin/nproc/nproc.1 | 7 | ||||
-rw-r--r-- | bin/nproc/nproc.c | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/bin/nproc/nproc.1 b/bin/nproc/nproc.1 index 91a87b1ca048..8ebe94a21049 100644 --- a/bin/nproc/nproc.1 +++ b/bin/nproc/nproc.1 @@ -3,7 +3,7 @@ .\" .\" * SPDX-License-Identifier: BSD-2-Clause .\" -.Dd February 5, 2023 +.Dd February 15, 2023 .Dt NPROC 1 .Os .Sh NAME @@ -40,6 +40,11 @@ Print usage information and exit. .El .Sh COMPATIBILITY This program is intended to be compatible with nproc as found in GNU coreutils. +.Sh BUGS +If HyperThreading is enabled in BIOS and disabled in the kernel, the +.Fl -all +option on Linux will still report all possible CPU threads. +On FreeBSD only active threads will be reported. .Sh SEE ALSO .Xr cpuset 1 .Sh HISTORY diff --git a/bin/nproc/nproc.c b/bin/nproc/nproc.c index 9037c74dbfff..c2ab75826ce1 100644 --- a/bin/nproc/nproc.c +++ b/bin/nproc/nproc.c @@ -110,7 +110,7 @@ main(int argc, char *argv[]) usage(); if (all_flag) { - cpus = sysconf(_SC_NPROCESSORS_ONLN); + cpus = sysconf(_SC_NPROCESSORS_CONF); if (cpus == -1) err(1, "sysconf"); } else { |