>>> import psutil
>>> 0 in psutil.get_pids()
False
>>> psutil.pid_exists(0)
True
>>>
This is similar to issue 23 of 4 years ago.
This happens because internally we use os.kill() and according to "man 2 kill":
> If pid equals 0, then sig is sent to every process
> in the process group of the calling process.
...which is definitively not what we want.
In case of PID 0 we should just "return 0 in get_pids()".
Original issue reported on code.google.com by g.rodola on 17 Dec 2013 at 1:55
Original issue reported on code.google.com by
g.rodola
on 17 Dec 2013 at 1:55