Subject: Re: remotely exitting a process
To: Frank van der Linden <fvdl@NetBSD.org>
From: Jaromir Dolecek <jdolecek@NetBSD.org>
List: tech-kern
Date: 12/04/2005 13:16:18
On Sun, Dec 04, 2005 at 11:21:08AM +0100, Frank van der Linden wrote:
> Emmanuel Dreyfus wrote
>
> >That does not fix all the problems: the parent still notices the SIGKILL
> >if it called wait4() on the child. Another idea?
>
> Processes that die because of a signal go through sigexit(). You can
> either change the process structure to have a p_exitcode, which, if !=
> -1, replaces the normal exitsig value passed to exit1() in that
> function. p_exitcode would be set to the exit value passed to
> linux_sys_exit_pgroup().
>
> Or, perhaps cleaner since it avoids changing the process structure, you
> can create an emul_sigexithook, which may be NULL, but if it isn't, it
> will return the value passed to exit1 (i.e. the value set in
> linux_sys_exit_pgroup()).
Perhaps we could just use a new process flag for that - it's only
necessary to reset exitsig to 0 for exit_group() in sigexit(), introducing
a function hook for that seems overkill.
Jaromir
--
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.cz/
-=- We can walk our road together if our goals are all the same; -=-
-=- We can run alone and free if we pursue a different aim. -=-