diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/sysconf_interceptor_bypass_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/sysconf_interceptor_bypass_test.cpp index 027aca579654..5e6bbad95451 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/sysconf_interceptor_bypass_test.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/sysconf_interceptor_bypass_test.cpp @@ -1,6 +1,7 @@ // RUN: %clangxx -O2 %s -o %t && %run %t 2>&1 | FileCheck %s #include +#include #if !defined(__GLIBC_PREREQ) #define __GLIBC_PREREQ(a, b) 0 @@ -10,10 +11,11 @@ // glbc version 2.16. #if __GLIBC_PREREQ(2, 16) extern "C" long sysconf(int name) { - if (name == 158 /*_SC_SIGSTKSZ */) { - // Asan calls it during initialization but late enough to succeed. +# ifdef _SC_SIGSTKSZ + // Asan needs this one during initialization but late enough to succeed. + if (name == _SC_SIGSTKSZ) return 0x10000; - } +# endif fprintf(stderr, "sysconf wrapper called: %d\n", name); return 0; }