Skip to content

Commit 2285aac

Browse files
mysterymathyuxuanchen1997
authored andcommitted
Revert "[compiler-rt] adding preadv2/pwritev2 interceptions." (#99085)
Reverts #97216
1 parent a8b45e6 commit 2285aac

File tree

3 files changed

+0
-65
lines changed

3 files changed

+0
-65
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10264,38 +10264,6 @@ INTERCEPTOR(int, cpuset_getaffinity, int level, int which, __int64_t id, SIZE_T
1026410264
#define INIT_CPUSET_GETAFFINITY
1026510265
#endif
1026610266

10267-
#if SANITIZER_INTERCEPT_PREADV2
10268-
INTERCEPTOR(SSIZE_T, preadv2, int fd, __sanitizer_iovec *iov, int iovcnt,
10269-
OFF_T offset, int flags) {
10270-
void *ctx;
10271-
COMMON_INTERCEPTOR_ENTER(ctx, preadv2, fd, iov, iovcnt, offset, flags);
10272-
COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd);
10273-
SSIZE_T res = REAL(preadv2)(fd, iov, iovcnt, offset, flags);
10274-
if (res > 0) write_iovec(ctx, iov, iovcnt, res);
10275-
if (res >= 0 && fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
10276-
return res;
10277-
}
10278-
#define INIT_PREADV2 COMMON_INTERCEPT_FUNCTION(preadv2)
10279-
#else
10280-
#define INIT_PREADV2
10281-
#endif
10282-
10283-
#if SANITIZER_INTERCEPT_PWRITEV2
10284-
INTERCEPTOR(SSIZE_T, pwritev2, int fd, __sanitizer_iovec *iov, int iovcnt,
10285-
OFF_T offset, int flags) {
10286-
void *ctx;
10287-
COMMON_INTERCEPTOR_ENTER(ctx, pwritev2, fd, iov, iovcnt, offset, flags);
10288-
COMMON_INTERCEPTOR_FD_ACCESS(ctx, fd);
10289-
if (fd >= 0) COMMON_INTERCEPTOR_FD_RELEASE(ctx, fd);
10290-
SSIZE_T res = REAL(pwritev2)(fd, iov, iovcnt, offset, flags);
10291-
if (res > 0) read_iovec(ctx, iov, iovcnt, res);
10292-
return res;
10293-
}
10294-
#define INIT_PWRITEV2 COMMON_INTERCEPT_FUNCTION(pwritev2)
10295-
#else
10296-
#define INIT_PWRITEV2
10297-
#endif
10298-
1029910267
#include "sanitizer_common_interceptors_netbsd_compat.inc"
1030010268

1030110269
namespace __sanitizer {
@@ -10615,8 +10583,6 @@ static void InitializeCommonInterceptors() {
1061510583
INIT___XUNAME;
1061610584
INIT_ARGP_PARSE;
1061710585
INIT_CPUSET_GETAFFINITY;
10618-
INIT_PREADV2;
10619-
INIT_PWRITEV2;
1062010586

1062110587
INIT___PRINTF_CHK;
1062210588
}

compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,6 @@
598598
#define SANITIZER_INTERCEPT_PROCCTL SI_FREEBSD
599599
#define SANITIZER_INTERCEPT_ARGP_PARSE SI_GLIBC
600600
#define SANITIZER_INTERCEPT_CPUSET_GETAFFINITY SI_FREEBSD
601-
// FIXME: also available from musl 1.2.5
602-
#define SANITIZER_INTERCEPT_PREADV2 SI_GLIBC
603-
#define SANITIZER_INTERCEPT_PWRITEV2 SI_GLIBC
604601

605602
// This macro gives a way for downstream users to override the above
606603
// interceptor macros irrespective of the platform they are on. They have

compiler-rt/test/sanitizer_common/TestCases/Linux/preadv2.cpp

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)