From mboxrd@z Thu Jan 1 00:00:00 1970 From: mulyadi.santosa@gmail.com (Mulyadi Santosa) Date: Mon, 29 Aug 2011 21:58:21 +0700 Subject: ptrace() behaviour when doing PTRACE_KILL In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hi pablo.... On Mon, Aug 29, 2011 at 14:47, Pablo Antonio 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