We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d39b02c commit 8ecbec1Copy full SHA for 8ecbec1
src/libstd/sys/unix/thread.rs
@@ -355,10 +355,9 @@ pub mod guard {
355
// macOS. Instead, just restore the page to a writable state.
356
// This ain't Linux, so we probably don't need to care about
357
// execstack.
358
- let result = mmap(stackaddr, PAGE_SIZE, PROT_READ | PROT_WRITE,
359
- MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
+ let result = mprotect(stackaddr, PAGE_SIZE, PROT_READ | PROT_WRITE);
360
361
- if result != stackaddr || result == MAP_FAILED {
+ if result != 0 {
362
panic!("unable to reset the guard page");
363
}
364
0 commit comments