From: Denys Vlasenko Date: Fri, 2 Jan 2009 18:02:45 +0000 (+0000) Subject: * defs.h, syscall.c: explain why x86 does not need TCB_WAITEXECVE trick, X-Git-Tag: v4.5.19~105 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc161ecae6dc18cef8739e6c066eb91ba8bf2634;p=strace * defs.h, syscall.c: explain why x86 does not need TCB_WAITEXECVE trick, and what syscall_fixup() is expected to do. Comments only, no code changes. --- diff --git a/defs.h b/defs.h index 4d4a78c8..e3cd93d0 100644 --- a/defs.h +++ b/defs.h @@ -360,6 +360,10 @@ struct tcb { #define TCB_FOLLOWFORK 00400 /* Process should have forks followed */ #define TCB_REPRINT 01000 /* We should reprint this syscall on exit */ #ifdef LINUX +/* x86 does not need TCB_WAITEXECVE. + * It can detect execve's SIGTRAP by looking at eax/rax. + * See "stray syscall exit: eax = " message in syscall_fixup(). + */ # if defined(ALPHA) || defined(SPARC) || defined(SPARC64) || defined(POWERPC) || defined(IA64) || defined(HPPA) || defined(SH) || defined(SH64) || defined(S390) || defined(S390X) || defined(ARM) || defined(MIPS) || defined(BFIN) # define TCB_WAITEXECVE 02000 /* ignore SIGTRAP after exceve */ # endif diff --git a/syscall.c b/syscall.c index 19f8fe9f..273b3c80 100644 --- a/syscall.c +++ b/syscall.c @@ -1335,6 +1335,13 @@ struct tcb *tcp; return scno; } +/* Called in trace_syscall() at each syscall entry and exit. + * Returns: + * 0: "ignore this syscall", bail out of trace_syscall() silently. + * 1: ok, continue in trace_syscall(). + * other: error, trace_syscall() should print error indicator + * ("????" etc) and bail out. + */ static int syscall_fixup(tcp) struct tcb *tcp;