On 13/05/2010 17:18, ольга крыжановская wrote:
AFAIK scripts should use getconf tags NPROCESSORS_CONF, NPROCESSORS_MAX or NPROCESSORS_ONLN (or just NPROCESSORS_ONLN because it describes the number of currently online cores) to determinate the number of processors it can use. This works on almost all platforms (Linux, FreeBSD, OpenBSD) and within ksh93's getconf.
It doesn't work with the /usr/bin/getconf on current OpenSolaris builds, but you are correct it does with with the ks93 built in getconf
However this case isn't about what "scripts" should or should not do and any mention of POSIX or POSIX features isn't releveant. It is about delivering the GNU coreutils as they are. Several people in the GNU community obviously thought the nproc tool was useful otherwise it wouldn't be in the coreutils package.
The reason I asked about the implementation was to make sure that the tool was using sysconf(3M) or something else "sensible" rather that doing something platform specific - I asked because I saw mention of Linux /proc and /sys in the GNU coreutils changelog in the context of the nproc program.
-- Darren J Moffat _______________________________________________ opensolaris-arc mailing list [email protected]
