ptrace() behaviour when doing PTRACE_KILL

Mulyadi Santosa mulyadi.santosa at gmail.com
Mon Aug 29 10:58:21 EDT 2011


Hi pablo....

On Mon, Aug 29, 2011 at 14:47, Pablo Antonio <pabloa at gmail.com> wrote:
 If the
> signal is delivered after the system call is completely executed, then
> I don't understand why this was working for the fork() and clone()
> case.
>
> I'd really appreciate if someone told me what's happening here, or
> what I'm not seeing.

I don't really get your question perfectly, but I guess you're
questioning about why kill() gets different result than fork()/clone
in term of order?

I guess that is the result of fork policy. Child, in Linux, AFAIK is
executed after parent. This is controlled via
/proc/sys/kernel/sched_child_runs_first. The effect is that, as you
can imagine, that parent take control first on anything over child. If
you change it, then child has a chance to do something ahead.

Again,  I don't claim I know your question perfectly, so as usual CMIIW.


-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com



More information about the Kernelnewbies mailing list