Files
rk35xx-android14/external/strace/linux/nios2/get_error.c
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

18 lines
515 B
C

static void
get_error(struct tcb *tcp, const bool check_errno)
{
/*
* The system call convention specifies that r2 contains the return
* value on success or a positive error number on failure. A flag
* indicating successful completion is written to r7; r7=0 indicates
* the system call success, r7=1 indicates an error. The positive
* errno value written in r2.
*/
if (nios2_regs.regs[7]) {
tcp->u_rval = -1;
tcp->u_error = nios2_regs.regs[2];
} else {
tcp->u_rval = nios2_regs.regs[2];
}
}