[compiler-rt] 52d7e18 - [sanitizer] Include fstab.h on glibc/FreeBSD/NetBSD/macOS

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 31 00:56:04 PST 2020


Author: Fangrui Song
Date: 2020-12-31T00:55:58-08:00
New Revision: 52d7e183bf25ea38e1149e39e19d21e6212e701f

URL: https://github.com/llvm/llvm-project/commit/52d7e183bf25ea38e1149e39e19d21e6212e701f
DIFF: https://github.com/llvm/llvm-project/commit/52d7e183bf25ea38e1149e39e19d21e6212e701f.diff

LOG: [sanitizer] Include fstab.h on glibc/FreeBSD/NetBSD/macOS

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
index b8f4fcd72644..957653dbbb7c 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -159,6 +159,8 @@ typedef struct user_fpregs elf_fpregset_t;
 #include <sys/vfs.h>
 #include <sys/epoll.h>
 #include <linux/capability.h>
+#else
+#include <fstab.h>
 #endif // SANITIZER_LINUX
 
 #if SANITIZER_MAC
@@ -205,9 +207,9 @@ namespace __sanitizer {
   unsigned struct_statfs64_sz = sizeof(struct statfs64);
 #endif // (SANITIZER_MAC && !TARGET_CPU_ARM64) && !SANITIZER_IOS
 
-#if SANITIZER_GLIBC
+#if SANITIZER_GLIBC || SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_MAC
   unsigned struct_fstab_sz = sizeof(struct fstab);
-#endif  // SANITIZER_GLIBC
+#endif  // SANITIZER_GLIBC || SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_MAC
 #if !SANITIZER_ANDROID
   unsigned struct_statfs_sz = sizeof(struct statfs);
   unsigned struct_sockaddr_sz = sizeof(struct sockaddr);


        


More information about the llvm-commits mailing list