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 argreg[MAX_ARGS] = { 6 PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5 7 }; 8 unsigned int i; 9 10 for (i = 0; i < tcp->s_ent->nargs; ++i) 11 if (upeek(tcp, argreg[i], &tcp->u_arg[i]) < 0) 12 return -1; 13 return 1; 14 } 15