The very short version: Unix PIDs do start at 0! PID 0 just isn’t shown to userspace through traditional APIs. PID 0 starts the kernel, then retires to a quiet life of helping a bit with process scheduling and power management. Also the entire web is mostly wrong about PID 0, because of one sentence on Wikipedia from 16 years ago.
There’s a slightly longer short version right at the end, or you can stick with me for the extremely long middle bit!
But surely you could just google what PID 0 is, right? Why am I even publishing this?
↫ David Anderson
What a great read. Just great.
great article!!!!
The Web being collectively and confidently wrong is pretty common for very low-level topics that only hyper-specialized people ever touched. I once had to look something up in a contemporary book on the 8086 and 80286 to get an answer that wasn’t decades of parroted BS.