Since util-linux/util-linux@6c87a3ac5e (taskset: Accept 0 pid for current
process), util-linux's taskset has accepted a 0 PID for the taskset
process.
Toybox has always had this behavior, inherited from sched_getaffinity(2)
and sched_setaffinity(2).
https://www.man7.org/linux/man-pages/man2/sched_getaffinity.2.html
Document the zero PID behavior and use it to simplify the tests.
Note that toybox and util-linux show different output. I'm not sure if
this should be considered a bug or not.
% ./toybox taskset 1 ./toybox taskset -p 0
pid 0's current affinity mask: 1
% ./taskset 1 ./taskset -p 0
pid 2140985's current affinity mask: 1
The build infrastructure adds a "make test_NAME" target for each NAME.test
file in this directory, and "make tests" iterates through all of them.
Individual tests boil down to a call to "scripts/test.sh NAME", and
testing all is "scripts/test.sh" with no arguments.
The test infrastructure, including the shell functions each test calls
(mostly "testcmd" and "optional") is described in scripts/test.sh