Subject: standards/24240: pthread_cond_wait shall not return EINTR
To: None <gnats-bugs@gnats.netbsd.org>
From: None <yamt@mwd.biglobe.ne.jp>
List: netbsd-bugs
Date: 01/26/2004 08:05:04
>Number:         24240
>Category:       standards
>Synopsis:       pthread_cond_wait shall not return EINTR
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    standards-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 25 23:06:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
>Release:        NetBSD 1.6ZH
>Organization:

>Environment:
	
	
System: NetBSD kaeru 1.6ZH NetBSD 1.6ZH (build.kaeru) #792: Sun Jan 25 18:03:43 JST 2004 takashi@kaeru:/usr/home/takashi/work/kernel/build.kaeru i386
Architecture: i386
Machine: i386
>Description:
	SUSv3 says that pthread_cond_timedwait and pthread_cond_wait
	shall not return EINTR.
	however, our 'nothread' version of them might do.
>How-To-Repeat:
	
>Fix:

Index: pthread_cond.c
===================================================================
RCS file: /cvsroot/src/lib/libpthread/pthread_cond.c,v
retrieving revision 1.14
diff -u -p -r1.14 pthread_cond.c
--- pthread_cond.c	2003/11/24 23:54:13	1.14
+++ pthread_cond.c	2004/01/25 22:59:13
@@ -392,5 +392,6 @@ pthread_cond_wait_nothread(pthread_t sel
 	if (retval == 0)
 		return ETIMEDOUT;
 	else
-		return EINTR;
+		/* spurious wakeup */
+		return 0;
 }
>Release-Note:
>Audit-Trail:
>Unformatted: