This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/386] pthread_create returns ENOMEM but should return EAGAIN
- From: "halesh dot s at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 3 Jul 2008 13:52:02 -0000
- Subject: [Bug nptl/386] pthread_create returns ENOMEM but should return EAGAIN
- References: <20040915163338.386.sebastien.decugis@ext.bull.net>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From halesh dot s at gmail dot com 2008-07-03 13:52 -------
Hi,
Even pthread_create() returns the errno, but it doestnot sets the errno EAGAIN,
instead it retains the ENOMEM. I have verified in glibc-2.7.
Thats why the attached testcase results in..
$gcc -o test test.c -lpthread
$./test
pthread_create : Cannot allocate memory -> 12
Created 405 threads
pthread_create : Cannot allocate memory -> 12
..........
..........
errno value set to 12 (ENOMEM)
but needs to be EAGAIN.
Ths attached patch fixes this issue.
$./test
pthread_create : Resource temporarily unavailable -> 11
Created 405 threads
pthread_create : Resource temporarily unavailable -> 11
................
................
Thanks,
Halesh
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|WORKSFORME |
http://sourceware.org/bugzilla/show_bug.cgi?id=386
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.