From: Denys Vlasenko Date: Wed, 8 Jun 2011 23:32:23 +0000 (+0200) Subject: Do not call umoven to fetch parameters if we have zero params X-Git-Tag: v4.7~382 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4660fe610c2b3707b15b170728a981440e1b54d4;p=strace Do not call umoven to fetch parameters if we have zero params * syscall.c [I386] (syscall_enter): Do not call umoven to fetch zero bytes. This is just an optimization. Signed-off-by: Denys Vlasenko --- diff --git a/syscall.c b/syscall.c index b7fabe00..c9a5b9f8 100644 --- a/syscall.c +++ b/syscall.c @@ -2352,8 +2352,9 @@ syscall_enter(struct tcb *tcp) tcp->u_nargs = sysent[tcp->scno].nargs; else tcp->u_nargs = 5; - umoven(tcp, tcp->status.PR_REG[UESP] + 4, - tcp->u_nargs*sizeof(tcp->u_arg[0]), (char *) tcp->u_arg); + if (tcp->u_nargs > 0) + umoven(tcp, tcp->status.PR_REG[UESP] + 4, + tcp->u_nargs*sizeof(tcp->u_arg[0]), (char *) tcp->u_arg); #else I DONT KNOW WHAT TO DO #endif /* !HAVE_PR_SYSCALL */