1 /* Return -1 on error or 1 on success (never 0!). */ 2 static int get_syscall_args(struct tcb * tcp)3get_syscall_args(struct tcb *tcp) 4 { 5 static const int syscall_regs[MAX_ARGS] = { 6 4 * (REG_REG0+4), 7 4 * (REG_REG0+5), 8 4 * (REG_REG0+6), 9 4 * (REG_REG0+7), 10 4 * (REG_REG0 ), 11 4 * (REG_REG0+1) 12 }; 13 unsigned int i; 14 15 for (i = 0; i < tcp->s_ent->nargs; ++i) 16 if (upeek(tcp->pid, syscall_regs[i], &tcp->u_arg[i]) < 0) 17 return -1; 18 return 1; 19 } 20