emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: proced: ppid of process ID 0 can be 0


From: Stefan Monnier
Subject: Re: proced: ppid of process ID 0 can be 0
Date: Tue, 30 Dec 2008 12:11:15 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>> >> > Processes that disappeared while Emacs was reading /proc, for example.
>> >> Then don't return them at all
>> > How?  I don't know enough about Linux kernel internals to decide which
>> > attribute's absence means that the process died while Emacs was
>> > reading /proc.
>> 
>> AFAIK we're talking about ppid, and this info is always present, so if
>> it's absent, don't return the process.

> Can you find any authoritative reference that says we can rely on
> this?  I couldn't even find a decent documentation of /proc when I was
> working on these primitives, let alone some information about what
> attributes are always present or how that changes with the kernel
> version.

The ppid is in the /proc/NNN/stat file, those attributes are
distinguished by their order, so if it's missing the ordering gets
messed up, so it can't be missing.  As for the /proc/NNN/stat file
missing, that would mean that pretty much all the attributes returned by
`ps' would be missing, so we can definitely count on its presence.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]