Skip to content

Commit

Permalink
Use MAP_STACK on OpenBSD.
Browse files Browse the repository at this point in the history
  • Loading branch information
qbit authored and laverdet committed Apr 29, 2019
1 parent aca1063 commit 6e43463
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libcoro/coro.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,11 @@ coro_stack_alloc (struct coro_stack *stack, unsigned int size)

#if CORO_MMAP
/* mmap supposedly does allocate-on-write for us */
#ifdef __OpenBSD__
base = mmap (0, ssze, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);
#else
base = mmap (0, ssze, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
#endif

if (base == (void *)-1)
{
Expand Down

0 comments on commit 6e43463

Please sign in to comment.