Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libpthread return errno if pthread_create hits the syste...
details: https://anonhg.NetBSD.org/src/rev/469e7941269b
branches: trunk
changeset: 781017:469e7941269b
user: drochner <drochner%NetBSD.org@localhost>
date: Wed Aug 15 13:28:32 2012 +0000
description:
return errno if pthread_create hits the system limit, not just -1
(this is not entirely correct because it can return ENOMEM which is
not mentioned in the spec, but there are other places in pthread_create
whete ENOMEM is returned -- it at all, this should be fixed everywhere)
diffstat:
lib/libpthread/pthread.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (26 lines):
diff -r 5589d0d23b3b -r 469e7941269b lib/libpthread/pthread.c
--- a/lib/libpthread/pthread.c Wed Aug 15 12:50:12 2012 +0000
+++ b/lib/libpthread/pthread.c Wed Aug 15 13:28:32 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread.c,v 1.136 2012/08/02 12:43:41 joerg Exp $ */
+/* $NetBSD: pthread.c,v 1.137 2012/08/15 13:28:32 drochner Exp $ */
/*-
* Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread.c,v 1.136 2012/08/02 12:43:41 joerg Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.137 2012/08/15 13:28:32 drochner Exp $");
#define __EXPOSE_STACK 1
@@ -498,6 +498,7 @@
flag |= LWP_SUSPENDED;
ret = _lwp_create(&newthread->pt_uc, flag, &newthread->pt_lid);
if (ret != 0) {
+ ret = errno;
pthread_mutex_lock(&newthread->pt_lock);
/* Will unlock and free name. */
pthread__reap(newthread);
Home |
Main Index |
Thread Index |
Old Index