diff options
author | Jack Lloyd <[email protected]> | 2019-06-21 06:43:35 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-06-21 06:43:35 -0400 |
commit | d31b68c301495d5b61d840a0c22c282cfae77db2 (patch) | |
tree | 4a891b26eba2f2a80ec46828af20b041ed7e4c54 /src/lib | |
parent | 5e2808f4314344afe73e72942d248f0db3707993 (diff) | |
parent | 30076c2413cef98445376fd679c6f691ad5c5f1d (diff) |
Merge GH #2001 Use FreeBSD PROT_MAX
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/utils/os_utils.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/utils/os_utils.cpp b/src/lib/utils/os_utils.cpp index f30f18ae9..098edaaf4 100644 --- a/src/lib/utils/os_utils.cpp +++ b/src/lib/utils/os_utils.cpp @@ -422,9 +422,13 @@ std::vector<void*> OS::allocate_locked_pages(size_t count) #define MAP_NOCORE 0 #endif #endif +#if !defined(PROT_MAX) + #define PROT_MAX(p) 0 +#endif + int pflags = PROT_READ | PROT_WRITE; ptr = ::mmap(nullptr, 2*page_size, - PROT_READ | PROT_WRITE, + pflags | PROT_MAX(pflags), MAP_ANONYMOUS | MAP_PRIVATE | MAP_NOCORE, /*fd=*/-1, /*offset=*/0); |