1 #include "negated_errno.h"
2 
3 #define get_error arm_get_error
4 #include "arm/get_error.c"
5 #undef get_error
6 
7 static void
get_error(struct tcb * tcp,const bool check_errno)8 get_error(struct tcb *tcp, const bool check_errno)
9 {
10 	if (tcp->currpers == 1) {
11 		arm_get_error(tcp, check_errno);
12 		return;
13 	}
14 
15 	if (check_errno && is_negated_errno(aarch64_regs.regs[0])) {
16 		tcp->u_rval = -1;
17 		tcp->u_error = -aarch64_regs.regs[0];
18 	} else {
19 		tcp->u_rval = aarch64_regs.regs[0];
20 	}
21 }
22