From 0cf41d5efd460f6695245a7ee68a85cf195b3f9b Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sat, 25 Apr 2009 11:43:15 -0700 Subject: [PATCH] Use MAP_TRYFIXED instead of MAP_FIXED when mapping the red zone. We want to fail if the user program already faulted through the zone, though in reality the red zone init occurs before main() is even run so there is no practical difference. --- lib/libthread_xu/thread/thr_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libthread_xu/thread/thr_init.c b/lib/libthread_xu/thread/thr_init.c index 8911e59177..ce7a26658d 100644 --- a/lib/libthread_xu/thread/thr_init.c +++ b/lib/libthread_xu/thread/thr_init.c @@ -259,7 +259,7 @@ init_main_thread(struct pthread *thread) */ if (mmap(_usrstack - _thr_stack_initial - _thr_guard_default, _thr_guard_default, - 0, MAP_ANON | MAP_FIXED, -1, 0) == MAP_FAILED) { + 0, MAP_ANON | MAP_TRYFIXED, -1, 0) == MAP_FAILED) { PANIC("Cannot allocate red zone for initial thread"); } -- 2.41.0