- Obtain maximum PID from kern.pid_max sysctl.
- Use kern.pid_max and hw.ncpu to calculate column widths in top(1).
- Always expect kern.pid_max to exists, instead of using hardcoded PID maximum value.
With those changes the kernel can be compiled with a higher PID_MAX value, eg. 999999.