Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There is no PID 0, it's a ABI convention just as using a negative PID is a convention to use the PGID instead like kill -9 -1. PIDs start at 1. The Linux kernel allocates PIDs to kernel threads that are "processes" without a separate address space running in a privileged mode with separate stacks, and generally ignore kill() signals.

Command to get when a Linux box was started as opposed to just running uptime -s:

    ps -p 2 -o lstart=


Okay. I said approximation, and saying that the approximation is not completely true is not that interesting.


Even in your own examples 0 means different things. It’s not an approximation, it’s wrong.


Being slightly wrong is kind of the thing that makes an approximation an approximation


All models are wrong, some are useful. I found his explanation useful while knowing it was not correct


But this statement is wrong and should not be propagated: "pid 0 refers to myself".

pid 0 refers to the thing that is running 'myself', not to myself, itself. It is the thing which gave way to allow 'myself' to be executing in the current context.

It is more accurate to say "pid 0 is the source of cpu 'attention' which allows myself 'awareness'", as it discovered I was not idle, and granted me power to proceed with processing ..


I think generalization would have been a better word but everyone understands what they meant


Why not

   ps -p 1 -o lstart=
?

In real life the difference should be rarely visible. And then, did we want to know when it started booting or when it became usable. The latter would be rather tricky (even defining what it exactly meant by that).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: