summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivano@gnu.org>2009-10-31 18:59:50 +0100
committerPádraig Brady <P@draigBrady.com>2009-11-06 16:54:12 +0000
commit74cf4cb26dcecd36eb45dc00dbd4587d9dc24a2f (patch)
tree226d1f3f872b413e09000e67bd8f20c5ffab6136 /doc
parent41456fac8ae69789b04196cb09788e1711b31cb3 (diff)
downloadcoreutils-74cf4cb26dcecd36eb45dc00dbd4587d9dc24a2f.tar.xz
nproc: A new program to count the available processors
* AUTHORS: Add my name. * NEWS: Mention it. * README: Likewise. * bootstrap.conf (gnulib_modules): Add nproc. * doc/coreutils.texi (nproc invocation): Add nproc info. * man/Makefile.am (nproc.1): Add dependency. * man/nproc.x: New template. * man/.gitignore: Ignore generated man page. * po/POTFILES.in: Add src/nproc.c. * src/.gitignore: Exclude nproc. * src/Makefile.am (EXTRA_PROGRAMS): Add nproc. * src/nproc.c: New file. * tests/Makefile.am (TESTS): Add misc/nproc-{avail,positive}. * tests/misc/nproc-avail: New file. * tests/misc/nproc-positive: New file.
Diffstat (limited to 'doc')
-rw-r--r--doc/coreutils.texi40
1 files changed, 40 insertions, 0 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 227014cd4..3fc3a52ca 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -84,6 +84,7 @@
* nice: (coreutils)nice invocation. Modify niceness.
* nl: (coreutils)nl invocation. Number lines and write files.
* nohup: (coreutils)nohup invocation. Immunize to hangups.
+* nproc: (coreutils)nproc invocation. Print the number of processors.
* od: (coreutils)od invocation. Dump files in octal, etc.
* paste: (coreutils)paste invocation. Merge lines of files.
* pathchk: (coreutils)pathchk invocation. Check file name portability.
@@ -410,6 +411,7 @@ System context
* arch invocation:: Print machine hardware name
* date invocation:: Print or set system date and time
+* nproc invocation:: Print the number of processors
* uname invocation:: Print system information
* hostname invocation:: Print or set system name
* hostid invocation:: Print numeric host identifier
@@ -13407,6 +13409,7 @@ information.
@menu
* date invocation:: Print or set system date and time.
* arch invocation:: Print machine hardware name.
+* nproc invocation:: Print the number of processors.
* uname invocation:: Print system information.
* hostname invocation:: Print or set system name.
* hostid invocation:: Print numeric host identifier.
@@ -14066,6 +14069,43 @@ The program accepts the @ref{Common options} only.
@exitstatus
+@node nproc invocation
+@section @command{nproc}: Print the number of available processors
+
+@pindex nproc
+@cindex Print the number of processors
+@cindex system information, printing
+
+Print the number of processing units available to the current process,
+which may be less than the number of online processors.
+If this information is not accessible, then print the number of
+processors installed. If the @env{OMP_NUM_THREADS} environment variable is
+set, then it will determine the returned value. The result is guaranteed to be
+greater than zero. Synopsis:
+
+@example
+nproc [@var{option}]
+@end example
+
+The program accepts the following options. Also see @ref{Common options}.
+
+@table @samp
+
+@item --all
+@opindex --all
+Print the number of installed processors on the system, which may
+be greater than the number online or available to the current process.
+The @env{OMP_NUM_THREADS} environment variable is not honored in this case.
+
+@item --ignore=@var{number}
+@opindex --ignore
+If possible, exclude this @var{number} of processing units.
+
+@end table
+
+@exitstatus
+
+
@node uname invocation
@section @command{uname}: Print system information