diff options
Diffstat (limited to 'absl/debugging/failure_signal_handler.cc')
-rw-r--r-- | absl/debugging/failure_signal_handler.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/absl/debugging/failure_signal_handler.cc b/absl/debugging/failure_signal_handler.cc index 3de45f0b..46ef7b8f 100644 --- a/absl/debugging/failure_signal_handler.cc +++ b/absl/debugging/failure_signal_handler.cc @@ -135,6 +135,9 @@ static bool SetupAlternateStackOnce() { #ifndef MAP_STACK #define MAP_STACK 0 #endif +#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS) +#define MAP_ANONYMOUS MAP_ANON +#endif sigstk.ss_sp = mmap(nullptr, sigstk.ss_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0); if (sigstk.ss_sp == MAP_FAILED) { @@ -162,8 +165,9 @@ static int MaybeSetupAlternateStack() { #ifndef _WIN32 ABSL_ATTRIBUTE_UNUSED static const bool kOnce = SetupAlternateStackOnce(); return SA_ONSTACK; -#endif +#else return 0; +#endif } #ifdef ABSL_HAVE_SIGACTION |