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: Roland Winkler
Subject: Re: proced: ppid of process ID 0 can be 0
Date: Sat, 20 Dec 2008 20:41:20 +0100

On Sat Dec 20 2008 Eli Zaretskii wrote:
> > I see two ways of fixing this: either removing the assumption from
> > proced.el, or forcing the Windows implementation of
> > system_process_attributes to adapt. First is more correct, second is
> > much easier (see tiny patch below).
> 
> I'd prefer that proced.el doesn't make such an unportable assumption.

I am not sure I get the point here. What is unportable where? I
mean, it seems to me that ultimately the solution is always the
same: when using the ppid attribute, one needs to make sure that it
is different from the corresponding pid. Or could one assign a
special meaning to the case that ppid=pid? There is no doubt that
proced assumes that ppid is always different from pid.

A comparison of ppid and pid can be implemented either on the level
of system_process_attributes. (I don't know whether for other
operating systems besides Windows we can have similar problems.) Or
it can be implemented inside proced. In the latter case, I would
implement the comparison of ppid and pid in
proced-process-attributes which is kind of the low-level function in
Proced calling system-process-attributes. (No other proced function
calls system-process-attributes.) So having the comparison of ppid
and pid in that function would work for proced for all operating
systems (requiring only a very small change in the code).

Yet anybody using system-process-attributes elsewhere might be
surprised that the return value of system-process-attributes can
give such meaningless results so that he/she probably would have to
implement the same check. So maybe for a clear definition of the
ppid attribute returned by system-process-attributes, we could
require that it must be different from pid.

Roland




reply via email to

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