@@ -974,7 +974,7 @@ INTERCEPTOR(SSIZE_T, read, int fd, void *ptr, SIZE_T count) {
974
974
// FIXME: under ASan the call below may write to freed memory and corrupt
975
975
// its metadata. See
976
976
// https://github.com/google/sanitizers/issues/321.
977
- SSIZE_T res = REAL (read)(fd, ptr, count);
977
+ SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL (read)(fd, ptr, count);
978
978
if (res > 0 ) COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ptr, res);
979
979
if (res >= 0 && fd >= 0 ) COMMON_INTERCEPTOR_FD_ACQUIRE (ctx, fd);
980
980
return res;
@@ -1009,7 +1009,7 @@ INTERCEPTOR(SSIZE_T, pread, int fd, void *ptr, SIZE_T count, OFF_T offset) {
1009
1009
// FIXME: under ASan the call below may write to freed memory and corrupt
1010
1010
// its metadata. See
1011
1011
// https://github.com/google/sanitizers/issues/321.
1012
- SSIZE_T res = REAL (pread)(fd, ptr, count, offset);
1012
+ SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL (pread)(fd, ptr, count, offset);
1013
1013
if (res > 0 ) COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ptr, res);
1014
1014
if (res >= 0 && fd >= 0 ) COMMON_INTERCEPTOR_FD_ACQUIRE (ctx, fd);
1015
1015
return res;
@@ -1027,7 +1027,7 @@ INTERCEPTOR(SSIZE_T, pread64, int fd, void *ptr, SIZE_T count, OFF64_T offset) {
1027
1027
// FIXME: under ASan the call below may write to freed memory and corrupt
1028
1028
// its metadata. See
1029
1029
// https://github.com/google/sanitizers/issues/321.
1030
- SSIZE_T res = REAL (pread64)(fd, ptr, count, offset);
1030
+ SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL (pread64)(fd, ptr, count, offset);
1031
1031
if (res > 0 ) COMMON_INTERCEPTOR_WRITE_RANGE (ctx, ptr, res);
1032
1032
if (res >= 0 && fd >= 0 ) COMMON_INTERCEPTOR_FD_ACQUIRE (ctx, fd);
1033
1033
return res;
@@ -1043,7 +1043,7 @@ INTERCEPTOR_WITH_SUFFIX(SSIZE_T, readv, int fd, __sanitizer_iovec *iov,
1043
1043
void *ctx;
1044
1044
COMMON_INTERCEPTOR_ENTER (ctx, readv, fd, iov, iovcnt);
1045
1045
COMMON_INTERCEPTOR_FD_ACCESS (ctx, fd);
1046
- SSIZE_T res = REAL (readv)(fd, iov, iovcnt);
1046
+ SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL (readv)(fd, iov, iovcnt);
1047
1047
if (res > 0 ) write_iovec (ctx, iov, iovcnt, res);
1048
1048
if (res >= 0 && fd >= 0 ) COMMON_INTERCEPTOR_FD_ACQUIRE (ctx, fd);
1049
1049
return res;
@@ -1059,7 +1059,7 @@ INTERCEPTOR(SSIZE_T, preadv, int fd, __sanitizer_iovec *iov, int iovcnt,
1059
1059
void *ctx;
1060
1060
COMMON_INTERCEPTOR_ENTER (ctx, preadv, fd, iov, iovcnt, offset);
1061
1061
COMMON_INTERCEPTOR_FD_ACCESS (ctx, fd);
1062
- SSIZE_T res = REAL (preadv)(fd, iov, iovcnt, offset);
1062
+ SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL (preadv)(fd, iov, iovcnt, offset);
1063
1063
if (res > 0 ) write_iovec (ctx, iov, iovcnt, res);
1064
1064
if (res >= 0 && fd >= 0 ) COMMON_INTERCEPTOR_FD_ACQUIRE (ctx, fd);
1065
1065
return res;
@@ -1075,7 +1075,8 @@ INTERCEPTOR(SSIZE_T, preadv64, int fd, __sanitizer_iovec *iov, int iovcnt,
1075
1075
void *ctx;
1076
1076
COMMON_INTERCEPTOR_ENTER (ctx, preadv64, fd, iov, iovcnt, offset);
1077
1077
COMMON_INTERCEPTOR_FD_ACCESS (ctx, fd);
1078
- SSIZE_T res = REAL (preadv64)(fd, iov, iovcnt, offset);
1078
+ SSIZE_T res =
1079
+ COMMON_INTERCEPTOR_BLOCK_REAL (preadv64)(fd, iov, iovcnt, offset);
1079
1080
if (res > 0 ) write_iovec (ctx, iov, iovcnt, res);
1080
1081
if (res >= 0 && fd >= 0 ) COMMON_INTERCEPTOR_FD_ACQUIRE (ctx, fd);
1081
1082
return res;
@@ -1091,8 +1092,9 @@ INTERCEPTOR(SSIZE_T, write, int fd, void *ptr, SIZE_T count) {
1091
1092
COMMON_INTERCEPTOR_ENTER (ctx, write, fd, ptr, count);
1092
1093
COMMON_INTERCEPTOR_FD_ACCESS (ctx, fd);
1093
1094
if (fd >= 0 ) COMMON_INTERCEPTOR_FD_RELEASE (ctx, fd);
1094
- SSIZE_T res = REAL (write)(fd, ptr, count);
1095
- // FIXME: this check should be _before_ the call to REAL(write), not after
1095
+ SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL (write)(fd, ptr, count);
1096
+ // FIXME: this check should be _before_ the call to
1097
+ // COMMON_INTERCEPTOR_BLOCK_REAL(write), not after
1096
1098
if (res > 0 ) COMMON_INTERCEPTOR_READ_RANGE (ctx, ptr, res);
1097
1099
return res;
1098
1100
}
@@ -1121,7 +1123,7 @@ INTERCEPTOR(SSIZE_T, pwrite, int fd, void *ptr, SIZE_T count, OFF_T offset) {
1121
1123
COMMON_INTERCEPTOR_ENTER (ctx, pwrite, fd, ptr, count, offset);
1122
1124
COMMON_INTERCEPTOR_FD_ACCESS (ctx, fd);
1123
1125
if (fd >= 0 ) COMMON_INTERCEPTOR_FD_RELEASE (ctx, fd);
1124
- SSIZE_T res = REAL (pwrite)(fd, ptr, count, offset);
1126
+ SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL (pwrite)(fd, ptr, count, offset);
1125
1127
if (res > 0 ) COMMON_INTERCEPTOR_READ_RANGE (ctx, ptr, res);
1126
1128
return res;
1127
1129
}
@@ -1137,7 +1139,7 @@ INTERCEPTOR(SSIZE_T, pwrite64, int fd, void *ptr, OFF64_T count,
1137
1139
COMMON_INTERCEPTOR_ENTER (ctx, pwrite64, fd, ptr, count, offset);
1138
1140
COMMON_INTERCEPTOR_FD_ACCESS (ctx, fd);
1139
1141
if (fd >= 0 ) COMMON_INTERCEPTOR_FD_RELEASE (ctx, fd);
1140
- SSIZE_T res = REAL (pwrite64)(fd, ptr, count, offset);
1142
+ SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL (pwrite64)(fd, ptr, count, offset);
1141
1143
if (res > 0 ) COMMON_INTERCEPTOR_READ_RANGE (ctx, ptr, res);
1142
1144
return res;
1143
1145
}
@@ -1153,7 +1155,7 @@ INTERCEPTOR_WITH_SUFFIX(SSIZE_T, writev, int fd, __sanitizer_iovec *iov,
1153
1155
COMMON_INTERCEPTOR_ENTER (ctx, writev, fd, iov, iovcnt);
1154
1156
COMMON_INTERCEPTOR_FD_ACCESS (ctx, fd);
1155
1157
if (fd >= 0 ) COMMON_INTERCEPTOR_FD_RELEASE (ctx, fd);
1156
- SSIZE_T res = REAL (writev)(fd, iov, iovcnt);
1158
+ SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL (writev)(fd, iov, iovcnt);
1157
1159
if (res > 0 ) read_iovec (ctx, iov, iovcnt, res);
1158
1160
return res;
1159
1161
}
@@ -1169,7 +1171,7 @@ INTERCEPTOR(SSIZE_T, pwritev, int fd, __sanitizer_iovec *iov, int iovcnt,
1169
1171
COMMON_INTERCEPTOR_ENTER (ctx, pwritev, fd, iov, iovcnt, offset);
1170
1172
COMMON_INTERCEPTOR_FD_ACCESS (ctx, fd);
1171
1173
if (fd >= 0 ) COMMON_INTERCEPTOR_FD_RELEASE (ctx, fd);
1172
- SSIZE_T res = REAL (pwritev)(fd, iov, iovcnt, offset);
1174
+ SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL (pwritev)(fd, iov, iovcnt, offset);
1173
1175
if (res > 0 ) read_iovec (ctx, iov, iovcnt, res);
1174
1176
return res;
1175
1177
}
@@ -1185,7 +1187,8 @@ INTERCEPTOR(SSIZE_T, pwritev64, int fd, __sanitizer_iovec *iov, int iovcnt,
1185
1187
COMMON_INTERCEPTOR_ENTER (ctx, pwritev64, fd, iov, iovcnt, offset);
1186
1188
COMMON_INTERCEPTOR_FD_ACCESS (ctx, fd);
1187
1189
if (fd >= 0 ) COMMON_INTERCEPTOR_FD_RELEASE (ctx, fd);
1188
- SSIZE_T res = REAL (pwritev64)(fd, iov, iovcnt, offset);
1190
+ SSIZE_T res =
1191
+ COMMON_INTERCEPTOR_BLOCK_REAL (pwritev64)(fd, iov, iovcnt, offset);
1189
1192
if (res > 0 ) read_iovec (ctx, iov, iovcnt, res);
1190
1193
return res;
1191
1194
}
@@ -2549,7 +2552,7 @@ INTERCEPTOR_WITH_SUFFIX(int, wait, int *status) {
2549
2552
// FIXME: under ASan the call below may write to freed memory and corrupt
2550
2553
// its metadata. See
2551
2554
// https://github.com/google/sanitizers/issues/321.
2552
- int res = REAL (wait)(status);
2555
+ int res = COMMON_INTERCEPTOR_BLOCK_REAL (wait)(status);
2553
2556
if (res != -1 && status)
2554
2557
COMMON_INTERCEPTOR_WRITE_RANGE (ctx, status, sizeof (*status));
2555
2558
return res;
@@ -2567,7 +2570,7 @@ INTERCEPTOR_WITH_SUFFIX(int, waitid, int idtype, int id, void *infop,
2567
2570
// FIXME: under ASan the call below may write to freed memory and corrupt
2568
2571
// its metadata. See
2569
2572
// https://github.com/google/sanitizers/issues/321.
2570
- int res = REAL (waitid)(idtype, id, infop, options);
2573
+ int res = COMMON_INTERCEPTOR_BLOCK_REAL (waitid)(idtype, id, infop, options);
2571
2574
if (res != -1 && infop)
2572
2575
COMMON_INTERCEPTOR_WRITE_RANGE (ctx, infop, siginfo_t_sz);
2573
2576
return res;
@@ -2578,7 +2581,7 @@ INTERCEPTOR_WITH_SUFFIX(int, waitpid, int pid, int *status, int options) {
2578
2581
// FIXME: under ASan the call below may write to freed memory and corrupt
2579
2582
// its metadata. See
2580
2583
// https://github.com/google/sanitizers/issues/321.
2581
- int res = REAL (waitpid)(pid, status, options);
2584
+ int res = COMMON_INTERCEPTOR_BLOCK_REAL (waitpid)(pid, status, options);
2582
2585
if (res != -1 && status)
2583
2586
COMMON_INTERCEPTOR_WRITE_RANGE (ctx, status, sizeof (*status));
2584
2587
return res;
@@ -2589,7 +2592,7 @@ INTERCEPTOR(int, wait3, int *status, int options, void *rusage) {
2589
2592
// FIXME: under ASan the call below may write to freed memory and corrupt
2590
2593
// its metadata. See
2591
2594
// https://github.com/google/sanitizers/issues/321.
2592
- int res = REAL (wait3)(status, options, rusage);
2595
+ int res = COMMON_INTERCEPTOR_BLOCK_REAL (wait3)(status, options, rusage);
2593
2596
if (res != -1 ) {
2594
2597
if (status) COMMON_INTERCEPTOR_WRITE_RANGE (ctx, status, sizeof (*status));
2595
2598
if (rusage) COMMON_INTERCEPTOR_WRITE_RANGE (ctx, rusage, struct_rusage_sz);
@@ -2603,7 +2606,8 @@ INTERCEPTOR(int, __wait4, int pid, int *status, int options, void *rusage) {
2603
2606
// FIXME: under ASan the call below may write to freed memory and corrupt
2604
2607
// its metadata. See
2605
2608
// https://github.com/google/sanitizers/issues/321.
2606
- int res = REAL (__wait4)(pid, status, options, rusage);
2609
+ int res =
2610
+ COMMON_INTERCEPTOR_BLOCK_REAL (__wait4)(pid, status, options, rusage);
2607
2611
if (res != -1 ) {
2608
2612
if (status) COMMON_INTERCEPTOR_WRITE_RANGE (ctx, status, sizeof (*status));
2609
2613
if (rusage) COMMON_INTERCEPTOR_WRITE_RANGE (ctx, rusage, struct_rusage_sz);
@@ -2618,7 +2622,7 @@ INTERCEPTOR(int, wait4, int pid, int *status, int options, void *rusage) {
2618
2622
// FIXME: under ASan the call below may write to freed memory and corrupt
2619
2623
// its metadata. See
2620
2624
// https://github.com/google/sanitizers/issues/321.
2621
- int res = REAL (wait4)(pid, status, options, rusage);
2625
+ int res = COMMON_INTERCEPTOR_BLOCK_REAL (wait4)(pid, status, options, rusage);
2622
2626
if (res != -1 ) {
2623
2627
if (status) COMMON_INTERCEPTOR_WRITE_RANGE (ctx, status, sizeof (*status));
2624
2628
if (rusage) COMMON_INTERCEPTOR_WRITE_RANGE (ctx, rusage, struct_rusage_sz);
@@ -2996,7 +3000,7 @@ INTERCEPTOR(int, accept, int fd, void *addr, unsigned *addrlen) {
2996
3000
COMMON_INTERCEPTOR_READ_RANGE (ctx, addrlen, sizeof (*addrlen));
2997
3001
addrlen0 = *addrlen;
2998
3002
}
2999
- int fd2 = REAL (accept)(fd, addr, addrlen);
3003
+ int fd2 = COMMON_INTERCEPTOR_BLOCK_REAL (accept)(fd, addr, addrlen);
3000
3004
if (fd2 >= 0 ) {
3001
3005
if (fd >= 0 ) COMMON_INTERCEPTOR_FD_SOCKET_ACCEPT (ctx, fd, fd2);
3002
3006
if (addr && addrlen)
@@ -3021,7 +3025,7 @@ INTERCEPTOR(int, accept4, int fd, void *addr, unsigned *addrlen, int f) {
3021
3025
// FIXME: under ASan the call below may write to freed memory and corrupt
3022
3026
// its metadata. See
3023
3027
// https://github.com/google/sanitizers/issues/321.
3024
- int fd2 = REAL (accept4)(fd, addr, addrlen, f);
3028
+ int fd2 = COMMON_INTERCEPTOR_BLOCK_REAL (accept4)(fd, addr, addrlen, f);
3025
3029
if (fd2 >= 0 ) {
3026
3030
if (fd >= 0 ) COMMON_INTERCEPTOR_FD_SOCKET_ACCEPT (ctx, fd, fd2);
3027
3031
if (addr && addrlen)
@@ -3045,7 +3049,7 @@ INTERCEPTOR(int, paccept, int fd, void *addr, unsigned *addrlen,
3045
3049
addrlen0 = *addrlen;
3046
3050
}
3047
3051
if (set) COMMON_INTERCEPTOR_READ_RANGE (ctx, set, sizeof (*set));
3048
- int fd2 = REAL (paccept)(fd, addr, addrlen, set, f);
3052
+ int fd2 = COMMON_INTERCEPTOR_BLOCK_REAL (paccept)(fd, addr, addrlen, set, f);
3049
3053
if (fd2 >= 0 ) {
3050
3054
if (fd >= 0 ) COMMON_INTERCEPTOR_FD_SOCKET_ACCEPT (ctx, fd, fd2);
3051
3055
if (addr && addrlen)
@@ -3126,7 +3130,7 @@ INTERCEPTOR(SSIZE_T, recvmsg, int fd, struct __sanitizer_msghdr *msg,
3126
3130
// FIXME: under ASan the call below may write to freed memory and corrupt
3127
3131
// its metadata. See
3128
3132
// https://github.com/google/sanitizers/issues/321.
3129
- SSIZE_T res = REAL (recvmsg)(fd, msg, flags);
3133
+ SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL (recvmsg)(fd, msg, flags);
3130
3134
if (res >= 0 ) {
3131
3135
if (fd >= 0 ) COMMON_INTERCEPTOR_FD_ACQUIRE (ctx, fd);
3132
3136
if (msg) {
@@ -3147,7 +3151,8 @@ INTERCEPTOR(int, recvmmsg, int fd, struct __sanitizer_mmsghdr *msgvec,
3147
3151
void *ctx;
3148
3152
COMMON_INTERCEPTOR_ENTER (ctx, recvmmsg, fd, msgvec, vlen, flags, timeout);
3149
3153
if (timeout) COMMON_INTERCEPTOR_READ_RANGE (ctx, timeout, struct_timespec_sz);
3150
- int res = REAL (recvmmsg)(fd, msgvec, vlen, flags, timeout);
3154
+ int res =
3155
+ COMMON_INTERCEPTOR_BLOCK_REAL (recvmmsg)(fd, msgvec, vlen, flags, timeout);
3151
3156
if (res >= 0 ) {
3152
3157
if (fd >= 0 ) COMMON_INTERCEPTOR_FD_ACQUIRE (ctx, fd);
3153
3158
for (int i = 0 ; i < res; ++i) {
@@ -3225,7 +3230,7 @@ INTERCEPTOR(SSIZE_T, sendmsg, int fd, struct __sanitizer_msghdr *msg,
3225
3230
COMMON_INTERCEPTOR_FD_ACCESS (ctx, fd);
3226
3231
COMMON_INTERCEPTOR_FD_RELEASE (ctx, fd);
3227
3232
}
3228
- SSIZE_T res = REAL (sendmsg)(fd, msg, flags);
3233
+ SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL (sendmsg)(fd, msg, flags);
3229
3234
if (common_flags ()->intercept_send && res >= 0 && msg)
3230
3235
read_msghdr (ctx, msg, res);
3231
3236
return res;
@@ -3244,7 +3249,7 @@ INTERCEPTOR(int, sendmmsg, int fd, struct __sanitizer_mmsghdr *msgvec,
3244
3249
COMMON_INTERCEPTOR_FD_ACCESS (ctx, fd);
3245
3250
COMMON_INTERCEPTOR_FD_RELEASE (ctx, fd);
3246
3251
}
3247
- int res = REAL (sendmmsg)(fd, msgvec, vlen, flags);
3252
+ int res = COMMON_INTERCEPTOR_BLOCK_REAL (sendmmsg)(fd, msgvec, vlen, flags);
3248
3253
if (res >= 0 && msgvec) {
3249
3254
for (int i = 0 ; i < res; ++i) {
3250
3255
COMMON_INTERCEPTOR_WRITE_RANGE (ctx, &msgvec[i].msg_len ,
@@ -3267,15 +3272,16 @@ INTERCEPTOR(int, msgsnd, int msqid, const void *msgp, SIZE_T msgsz,
3267
3272
COMMON_INTERCEPTOR_ENTER (ctx, msgsnd, msqid, msgp, msgsz, msgflg);
3268
3273
if (msgp)
3269
3274
COMMON_INTERCEPTOR_READ_RANGE (ctx, msgp, sizeof (long ) + msgsz);
3270
- int res = REAL (msgsnd)(msqid, msgp, msgsz, msgflg);
3275
+ int res = COMMON_INTERCEPTOR_BLOCK_REAL (msgsnd)(msqid, msgp, msgsz, msgflg);
3271
3276
return res;
3272
3277
}
3273
3278
3274
3279
INTERCEPTOR (SSIZE_T, msgrcv, int msqid, void *msgp, SIZE_T msgsz,
3275
3280
long msgtyp, int msgflg) {
3276
3281
void *ctx;
3277
3282
COMMON_INTERCEPTOR_ENTER (ctx, msgrcv, msqid, msgp, msgsz, msgtyp, msgflg);
3278
- SSIZE_T len = REAL (msgrcv)(msqid, msgp, msgsz, msgtyp, msgflg);
3283
+ SSIZE_T len =
3284
+ COMMON_INTERCEPTOR_BLOCK_REAL (msgrcv)(msqid, msgp, msgsz, msgtyp, msgflg);
3279
3285
if (len != -1 )
3280
3286
COMMON_INTERCEPTOR_WRITE_RANGE (ctx, msgp, sizeof (long ) + len);
3281
3287
return len;
@@ -6119,7 +6125,7 @@ INTERCEPTOR(int, flopen, const char *path, int flags, ...) {
6119
6125
if (path) {
6120
6126
COMMON_INTERCEPTOR_READ_RANGE (ctx, path, internal_strlen (path) + 1 );
6121
6127
}
6122
- return REAL (flopen)(path, flags, mode);
6128
+ return COMMON_INTERCEPTOR_BLOCK_REAL (flopen)(path, flags, mode);
6123
6129
}
6124
6130
6125
6131
INTERCEPTOR (int , flopenat, int dirfd, const char *path, int flags, ...) {
@@ -6132,7 +6138,7 @@ INTERCEPTOR(int, flopenat, int dirfd, const char *path, int flags, ...) {
6132
6138
if (path) {
6133
6139
COMMON_INTERCEPTOR_READ_RANGE (ctx, path, internal_strlen (path) + 1 );
6134
6140
}
6135
- return REAL (flopenat)(dirfd, path, flags, mode);
6141
+ return COMMON_INTERCEPTOR_BLOCK_REAL (flopenat)(dirfd, path, flags, mode);
6136
6142
}
6137
6143
6138
6144
#define INIT_FLOPEN \
@@ -6717,7 +6723,7 @@ INTERCEPTOR(SSIZE_T, recv, int fd, void *buf, SIZE_T len, int flags) {
6717
6723
void *ctx;
6718
6724
COMMON_INTERCEPTOR_ENTER (ctx, recv, fd, buf, len, flags);
6719
6725
COMMON_INTERCEPTOR_FD_ACCESS (ctx, fd);
6720
- SSIZE_T res = REAL (recv)(fd, buf, len, flags);
6726
+ SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL (recv)(fd, buf, len, flags);
6721
6727
if (res > 0 ) {
6722
6728
COMMON_INTERCEPTOR_WRITE_RANGE (ctx, buf, Min ((SIZE_T)res, len));
6723
6729
}
@@ -6734,7 +6740,8 @@ INTERCEPTOR(SSIZE_T, recvfrom, int fd, void *buf, SIZE_T len, int flags,
6734
6740
SIZE_T srcaddr_sz;
6735
6741
if (srcaddr) srcaddr_sz = *addrlen;
6736
6742
(void )srcaddr_sz; // prevent "set but not used" warning
6737
- SSIZE_T res = REAL (recvfrom)(fd, buf, len, flags, srcaddr, addrlen);
6743
+ SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL (recvfrom)(fd, buf, len, flags,
6744
+ srcaddr, addrlen);
6738
6745
if (res > 0 )
6739
6746
COMMON_INTERCEPTOR_WRITE_RANGE (ctx, buf, Min ((SIZE_T)res, len));
6740
6747
if (res >= 0 && srcaddr)
@@ -6757,7 +6764,7 @@ INTERCEPTOR(SSIZE_T, send, int fd, void *buf, SIZE_T len, int flags) {
6757
6764
COMMON_INTERCEPTOR_FD_ACCESS (ctx, fd);
6758
6765
COMMON_INTERCEPTOR_FD_RELEASE (ctx, fd);
6759
6766
}
6760
- SSIZE_T res = REAL (send)(fd, buf, len, flags);
6767
+ SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL (send)(fd, buf, len, flags);
6761
6768
if (common_flags ()->intercept_send && res > 0 )
6762
6769
COMMON_INTERCEPTOR_READ_RANGE (ctx, buf, Min ((SIZE_T)res, len));
6763
6770
return res;
@@ -6772,7 +6779,8 @@ INTERCEPTOR(SSIZE_T, sendto, int fd, void *buf, SIZE_T len, int flags,
6772
6779
COMMON_INTERCEPTOR_FD_RELEASE (ctx, fd);
6773
6780
}
6774
6781
// Can't check dstaddr as it may have uninitialized padding at the end.
6775
- SSIZE_T res = REAL (sendto)(fd, buf, len, flags, dstaddr, addrlen);
6782
+ SSIZE_T res = COMMON_INTERCEPTOR_BLOCK_REAL (sendto)(fd, buf, len, flags,
6783
+ dstaddr, addrlen);
6776
6784
if (common_flags ()->intercept_send && res > 0 )
6777
6785
COMMON_INTERCEPTOR_READ_RANGE (ctx, buf, Min ((SIZE_T)res, len));
6778
6786
return res;
@@ -6789,7 +6797,7 @@ INTERCEPTOR(int, eventfd_read, int fd, __sanitizer_eventfd_t *value) {
6789
6797
void *ctx;
6790
6798
COMMON_INTERCEPTOR_ENTER (ctx, eventfd_read, fd, value);
6791
6799
COMMON_INTERCEPTOR_FD_ACCESS (ctx, fd);
6792
- int res = REAL (eventfd_read)(fd, value);
6800
+ int res = COMMON_INTERCEPTOR_BLOCK_REAL (eventfd_read)(fd, value);
6793
6801
if (res == 0 ) {
6794
6802
COMMON_INTERCEPTOR_WRITE_RANGE (ctx, value, sizeof (*value));
6795
6803
if (fd >= 0 ) COMMON_INTERCEPTOR_FD_ACQUIRE (ctx, fd);
@@ -6803,7 +6811,7 @@ INTERCEPTOR(int, eventfd_write, int fd, __sanitizer_eventfd_t value) {
6803
6811
COMMON_INTERCEPTOR_FD_ACCESS (ctx, fd);
6804
6812
COMMON_INTERCEPTOR_FD_RELEASE (ctx, fd);
6805
6813
}
6806
- int res = REAL (eventfd_write)(fd, value);
6814
+ int res = COMMON_INTERCEPTOR_BLOCK_REAL (eventfd_write)(fd, value);
6807
6815
return res;
6808
6816
}
6809
6817
#define INIT_EVENTFD_READ_WRITE \
@@ -7426,7 +7434,8 @@ INTERCEPTOR(int, open_by_handle_at, int mount_fd, struct file_handle* handle,
7426
7434
COMMON_INTERCEPTOR_READ_RANGE (
7427
7435
ctx, &sanitizer_handle->f_handle , sanitizer_handle->handle_bytes );
7428
7436
7429
- return REAL (open_by_handle_at)(mount_fd, handle, flags);
7437
+ return COMMON_INTERCEPTOR_BLOCK_REAL (open_by_handle_at)(mount_fd, handle,
7438
+ flags);
7430
7439
}
7431
7440
7432
7441
#define INIT_OPEN_BY_HANDLE_AT COMMON_INTERCEPT_FUNCTION (open_by_handle_at)
0 commit comments