From 4d6b4178c8e49dd6d3067a399e2a49d5379b7750 Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Wed, 4 Jul 2018 17:55:33 +0200 Subject: nptl: Do not use madvise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit start_thread() uses it, but it is not supported on MMU-less systems. * libpthread/nptl/pthread_create.c (start_thread): Call madvise only if __ARCH_USE_MMU__ is defined. Signed-off-by: Mickaël Guêné Signed-off-by: Christophe Lyon --- libpthread/nptl/pthread_create.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libpthread/nptl') diff --git a/libpthread/nptl/pthread_create.c b/libpthread/nptl/pthread_create.c index 3064b40dd..5a7957d6a 100644 --- a/libpthread/nptl/pthread_create.c +++ b/libpthread/nptl/pthread_create.c @@ -373,8 +373,12 @@ start_thread (void *arg) size_t freesize = ((char *) pd->stackblock - sp) & ~pagesize_m1; #endif assert (freesize < pd->stackblock_size); + + /* madvise is not supported on MMU-less systems. */ +#ifdef __ARCH_USE_MMU__ if (freesize > PTHREAD_STACK_MIN) madvise (pd->stackblock, freesize - PTHREAD_STACK_MIN, MADV_DONTNEED); +#endif /* If the thread is detached free the TCB. */ if (IS_DETACHED (pd)) -- cgit v1.2.3