cfengine/core — pull request #234 by mvpel (2012-11-16 04:09:34+00:00)
Title: Implement CPU counts for platforms other than Linux & HP-UX, except Win

Replaces Linux /proc/stat parsing with sysinfo() call, which returns the same result but also works on various other platforms. Adds sysctl() call for BSD-derived platforms. With HP-UX mpctl(), this ought to cover all other platforms except Windows - suggested code for Win is included as a comment, but I have no way to compile or test it.

Documentation update removed Linux-only caveat for $(sys.cpus), clarified virtual vs. physical CPUs, and added mention of hard classes which are set.

Configure.ac update adds the check for BSD sys/sysctl.h for CPU counting on that platform, and the necessary includes are added in sysinfo.c. These updates are written in such a way that they will be easy to merge with pull request https://github.com/cfengine/core/pull/229 - they overlap a bit in both configure.ac and sysinfo.c - just give 229 precedence over this one. They're here only to make this my cpu_count branch self-sufficient.