From 4660fe610c2b3707b15b170728a981440e1b54d4 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 9 Jun 2011 01:32:23 +0200 Subject: [PATCH] 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 --- syscall.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 */ -- 2.40.0