]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: nproc: mention OpenMP env vars in --help
authorPádraig Brady <P@draigBrady.com>
Sat, 24 Jan 2026 13:34:35 +0000 (13:34 +0000)
committerPádraig Brady <P@draigBrady.com>
Sat, 24 Jan 2026 13:49:03 +0000 (13:49 +0000)
* src/nproc.c (usage): Clarify the impact of 'OMP_NUM_THREADS'
and 'OMP_THREAD_LIMIT' in --help and the man page.
Also mention that nproc(1) will always return > 0.
Fixes https://bugs.gnu.org/80243

src/nproc.c

index 0ff44a6b9a84a63f388fb5a529ccf535c56e54de..86ae76c4c2a0d55b00d602e12039acd1296d2afc 100644 (file)
@@ -56,16 +56,20 @@ usage (int status)
       printf (_("Usage: %s [OPTION]...\n"), program_name);
       fputs (_("\
 Print the number of processing units available to the current process,\n\
-which may be less than the number of online processors\n\
+which may be less than the number of online processors.\n\
+If the 'OMP_NUM_THREADS' or 'OMP_THREAD_LIMIT' environment variables are set,\n\
+then they will determine the minimum and maximum returned value respectively.\n\
 \n\
 "), stdout);
       oputs (_("\
       --all\n\
-         print the number of installed processors\n\
+         print the number of installed processors,\n\
+         disregarding any OpenMP environment variables, or CPU quotas.\n\
 "));
       oputs (_("\
       --ignore=N\n\
-         if possible, exclude N processing units\n\
+         if possible, exclude N processing units.\n\
+         The result is guaranteed to be at least 1.\n\
 "));
 
       oputs (HELP_OPTION_DESCRIPTION);