@@ -347,11 +347,33 @@ INTERCEPTOR(int, setvbuf, FILE *stream, char *buf, int mode, size_t size) {
347
347
__rtsan_notify_intercepted_call (" setvbuf" );
348
348
return REAL (setvbuf)(stream, buf, mode, size);
349
349
}
350
+
351
+ #if SANITIZER_LINUX
352
+ INTERCEPTOR (void , setlinebuf, FILE *stream) {
353
+ #else
354
+ INTERCEPTOR (int , setlinebuf, FILE *stream) {
355
+ #endif
356
+ __rtsan_notify_intercepted_call (" setlinebuf" );
357
+ return REAL (setlinebuf)(stream);
358
+ }
359
+
360
+ #if SANITIZER_LINUX
361
+ INTERCEPTOR (void , setbuffer, FILE *stream, char *buf, size_t size) {
362
+ #else
363
+ INTERCEPTOR (void , setbuffer, FILE *stream, char *buf, int size) {
364
+ #endif
365
+ __rtsan_notify_intercepted_call (" setbuffer" );
366
+ return REAL (setbuffer)(stream, buf, size);
367
+ }
350
368
#define RTSAN_MAYBE_INTERCEPT_SETBUF INTERCEPT_FUNCTION (setbuf)
351
369
#define RTSAN_MAYBE_INTERCEPT_SETVBUF INTERCEPT_FUNCTION (setvbuf)
370
+ #define RTSAN_MAYBE_INTERCEPT_SETLINEBUF INTERCEPT_FUNCTION (setlinebuf)
371
+ #define RTSAN_MAYBE_INTERCEPT_SETBUFFER INTERCEPT_FUNCTION (setbuffer)
352
372
#else
353
373
#define RTSAN_MAYBE_INTERCEPT_SETBUF
354
374
#define RTSAN_MAYBE_INTERCEPT_SETVBUF
375
+ #define RTSAN_MAYBE_INTERCEPT_SETLINEBUF
376
+ #define RTSAN_MAYBE_INTERCEPT_SETBUFFER
355
377
#endif
356
378
357
379
INTERCEPTOR (int , puts, const char *s) {
@@ -1018,6 +1040,8 @@ void __rtsan::InitializeInterceptors() {
1018
1040
RTSAN_MAYBE_INTERCEPT_FMEMOPEN;
1019
1041
RTSAN_MAYBE_INTERCEPT_SETBUF;
1020
1042
RTSAN_MAYBE_INTERCEPT_SETVBUF;
1043
+ RTSAN_MAYBE_INTERCEPT_SETLINEBUF;
1044
+ RTSAN_MAYBE_INTERCEPT_SETBUFFER;
1021
1045
INTERCEPT_FUNCTION (lseek);
1022
1046
RTSAN_MAYBE_INTERCEPT_LSEEK64;
1023
1047
INTERCEPT_FUNCTION (dup);
0 commit comments