about summary refs log tree commit diff
path: root/src/thread/pthread_create.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015-06-17 17:21:46 +0000
committerRich Felker <dalias@aerifal.cx>2015-06-17 17:21:46 +0000
commit75eceb3ae824d54e865686c0c538551aeebf3372 (patch)
treee6b3b7c367af9a1040c4f06161e957b050d1370e /src/thread/pthread_create.c
parent10d0268ccfab9152250eeeed3952ce3fed44131a (diff)
downloadmusl-75eceb3ae824d54e865686c0c538551aeebf3372.tar.gz
musl-75eceb3ae824d54e865686c0c538551aeebf3372.tar.xz
musl-75eceb3ae824d54e865686c0c538551aeebf3372.zip
ignore ENOSYS error from mprotect in pthread_create and dynamic linker
this error simply indicated a system without memory protection (NOMMU)
and should not cause failure in the caller.
Diffstat (limited to 'src/thread/pthread_create.c')
-rw-r--r--src/thread/pthread_create.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
index 6e2e4816..e7df34a9 100644
--- a/src/thread/pthread_create.c
+++ b/src/thread/pthread_create.c
@@ -232,7 +232,8 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
 		if (guard) {
 			map = __mmap(0, size, PROT_NONE, MAP_PRIVATE|MAP_ANON, -1, 0);
 			if (map == MAP_FAILED) goto fail;
-			if (__mprotect(map+guard, size-guard, PROT_READ|PROT_WRITE)) {
+			if (__mprotect(map+guard, size-guard, PROT_READ|PROT_WRITE)
+			    && errno != ENOSYS) {
 				__munmap(map, size);
 				goto fail;
 			}