forked from OSchip/llvm-project
Revert "[Sanitizer] intercept setvbuf on other platforms where it is supported"
llvm-svn: 347358
This commit is contained in:
parent
a1ea566fbc
commit
d931c135f0
|
@ -7306,8 +7306,6 @@ INTERCEPTOR(int, setvbuf, __sanitizer_FILE *stream, char *buf, int mode,
|
|||
int ret = REAL(setvbuf)(stream, buf, mode, size);
|
||||
if (buf)
|
||||
COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, size);
|
||||
if (ret == 0)
|
||||
unpoison_file(stream);
|
||||
return ret;
|
||||
}
|
||||
#define INIT_SETVBUF COMMON_INTERCEPT_FUNCTION(setvbuf)
|
||||
|
|
|
@ -516,8 +516,7 @@
|
|||
#define SANITIZER_INTERCEPT_TTYENT SI_NETBSD
|
||||
#define SANITIZER_INTERCEPT_PROTOENT SI_NETBSD
|
||||
#define SANITIZER_INTERCEPT_NETENT SI_NETBSD
|
||||
#define SANITIZER_INTERCEPT_SETVBUF (SI_NETBSD || SI_FREEBSD || \
|
||||
SI_LINUX || SI_MAC)
|
||||
#define SANITIZER_INTERCEPT_SETVBUF SI_NETBSD
|
||||
#define SANITIZER_INTERCEPT_GETMNTINFO SI_NETBSD
|
||||
#define SANITIZER_INTERCEPT_MI_VECTOR_HASH SI_NETBSD
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
// RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s
|
||||
|
||||
// UNSUPPORTED: solaris
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void print_something() {
|
||||
|
@ -9,9 +7,6 @@ void print_something() {
|
|||
printf("Hello world %zu\n", i);
|
||||
}
|
||||
|
||||
// setbuffer/setlinebuf/setbuf uses setvbuf
|
||||
// internally on NetBSD
|
||||
#if defined(__NetBSD__)
|
||||
void test_setbuf() {
|
||||
char buf[BUFSIZ];
|
||||
|
||||
|
@ -41,7 +36,6 @@ void test_setlinebuf() {
|
|||
|
||||
print_something();
|
||||
}
|
||||
#endif
|
||||
|
||||
void test_setvbuf() {
|
||||
char buf[BUFSIZ];
|
||||
|
@ -62,11 +56,9 @@ void test_setvbuf() {
|
|||
int main(void) {
|
||||
printf("setvbuf\n");
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
test_setbuf();
|
||||
test_setbuffer();
|
||||
test_setlinebuf();
|
||||
#endif
|
||||
test_setvbuf();
|
||||
|
||||
// CHECK: setvbuf
|
Loading…
Reference in New Issue