Branch data Line data Source code
1 : : #include "negated_errno.h"
2 : :
3 : : static void
4 : 447626 : get_error(struct tcb *tcp, const bool check_errno)
5 : : {
6 : : /*
7 : : * In X32, return value is 64-bit (llseek uses one).
8 : : * Using merely "long rax" would not work.
9 : : */
10 : : long long rax;
11 : :
12 [ + + ]: 447626 : if (x86_io.iov_len == sizeof(i386_regs)) {
13 : : /* Sign extend from 32 bits */
14 : 198220 : rax = (int32_t) i386_regs.eax;
15 : : } else {
16 : 249406 : rax = x86_64_regs.rax;
17 : : }
18 : :
19 [ + + ][ + + ]: 895077 : if (check_errno && is_negated_errno(rax)) {
20 : 205542 : tcp->u_rval = -1;
21 : 205542 : tcp->u_error = -rax;
22 : : } else {
23 : 242084 : tcp->u_rval = rax;
24 : : }
25 : 447626 : }
|