Skip to content

Commit

Permalink
fix MAP_ANONYMOUS for old Mac OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Kowalke committed Jul 9, 2014
1 parent 6def88c commit 1005688
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/boost/coroutine/posix/protected_stack_allocator.hpp
Expand Up @@ -53,7 +53,11 @@ struct basic_protected_stack_allocator
BOOST_ASSERT( size_ <= size);

// conform to POSIX.4 (POSIX.1b-1993, _POSIX_C_SOURCE=199309L)
#if defined(MAP_ANON)
void * limit = ::mmap( 0, size_, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
#else
void * limit = ::mmap( 0, size_, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
#endif
if ( MAP_FAILED == limit) throw std::bad_alloc();

// conforming to POSIX.1-2001
Expand Down

0 comments on commit 1005688

Please sign in to comment.