From 3ad2320789d6a0f3c885b2f5213807f64dda16e8 Mon Sep 17 00:00:00 2001 From: chs Date: Wed, 19 Oct 2005 02:44:45 +0000 Subject: [PATCH] if mlock() fails in pthread_create(), return EAGAIN instead of failing an assertion. --- lib/libpthread/pthread.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/libpthread/pthread.c b/lib/libpthread/pthread.c index 1ab792450e2a..0969a57afddb 100644 --- a/lib/libpthread/pthread.c +++ b/lib/libpthread/pthread.c @@ -1,4 +1,4 @@ -/* $NetBSD: pthread.c,v 1.45 2005/10/19 02:15:03 chs Exp $ */ +/* $NetBSD: pthread.c,v 1.46 2005/10/19 02:44:45 chs Exp $ */ /*- * Copyright (c) 2001,2002,2003 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__RCSID("$NetBSD: pthread.c,v 1.45 2005/10/19 02:15:03 chs Exp $"); +__RCSID("$NetBSD: pthread.c,v 1.46 2005/10/19 02:44:45 chs Exp $"); #include #include @@ -373,7 +373,9 @@ pthread_create(pthread_t *thread, const pthread_attr_t *attr, } #ifdef PTHREAD_MLOCK_KLUDGE ret = mlock(newthread, sizeof(struct __pthread_st)); - pthread__assert(ret == 0); + if (ret < 0) { + return EAGAIN; + } #endif }