----- "Avi Kivity" <avi@xxxxxxxxxx> wrote: > On 08/05/2009 06:48 PM, Michael Goldish wrote: > > > > > >> You should use wait() to find out if the process is alive, not > tricks > >> with the PID and process name, which are racy as you found out. > >> > > > > I'm not sure I can do that because the process I'm interested in > isn't a > > child of mine. > > > > It should be somebody's child and that somebody should wait for it. I can find out if the parent process is alive by checking a lock file. A little while ago I couldn't afford to do that in is_alive() because it would cause a deadlock, but now this shouldn't be a problem. I'll test it and if it works it'll greatly simplify is_alive(). > > In any case, I'd still need to use the process name to make sure the > PID > > belongs to the original process, because PIDs are reused after a > while. > > > > waitpid() solves that problem without using the process name. This > isn't a new problem, you should use the established solutions. > > -- > error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html