cpuset: add --count
Can be used to count the number of hardware threads in the cpu set.
For example:
$ cpuset -g -p $$
pid 2440 mask: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39
pid 2440 domain policy: first-touch mask: 0, 1
$ cpuset -g --count -p $$
40
The intent is to replace calls to sysctl hw.ncpu and kern.smp.cpus which
can be found in the tree, which are not adequate given existence of
cpusets.
Right now only -g -p combination is supported to reduce complexity.
As anything else errors out, this can be expanded later as needed.
Differential Revision: https://reviews.freebsd.org/D36351