[compiler-rt] [compiler-rt][rtsan] fseek api interception. (PR #122163)

Chris Apple via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 10 03:11:29 PST 2025


================
@@ -376,6 +376,95 @@ INTERCEPTOR(void, setbuffer, FILE *stream, char *buf, int size) {
 #define RTSAN_MAYBE_INTERCEPT_SETBUFFER
 #endif
 
+#if SANITIZER_INTERCEPT_FSEEK
----------------
cjappl wrote:

This is more of a question - I don't have the answer. Should all of these be inside this ifdef? Should some of them be outside of it? 

For instance, on my mac, I have access to many of these:

```
FSEEK(3)                   Library Functions Manual                   FSEEK(3)

NAME
     fgetpos, fseek, fseeko, fsetpos, ftell, ftello, rewind – reposition a
     stream
```

And it seems like these only have support for BSD flavors:
```
#define SANITIZER_INTERCEPT_FSEEK (SI_NETBSD || SI_FREEBSD)

```

Even normally flavored linux has many of these https://www.man7.org/linux/man-pages/man3/fseek.3.html

Maybe this macro needs updating?

https://github.com/llvm/llvm-project/pull/122163


More information about the llvm-commits mailing list