Module Name: src
Committed By: joerg
Date: Fri Apr 22 14:18:34 UTC 2011
Modified Files:
src/lib/libpthread: pthread_cancelstub.c
Log Message:
Don't kill the read(2) stub, just the magic around it.
To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/lib/libpthread/pthread_cancelstub.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libpthread/pthread_cancelstub.c
diff -u src/lib/libpthread/pthread_cancelstub.c:1.34 src/lib/libpthread/pthread_cancelstub.c:1.35
--- src/lib/libpthread/pthread_cancelstub.c:1.34 Thu Apr 21 13:38:14 2011
+++ src/lib/libpthread/pthread_cancelstub.c Fri Apr 22 14:18:34 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_cancelstub.c,v 1.34 2011/04/21 13:38:14 joerg Exp $ */
+/* $NetBSD: pthread_cancelstub.c,v 1.35 2011/04/22 14:18:34 joerg Exp $ */
/*-
* Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
#undef _FORTIFY_SOURCE
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_cancelstub.c,v 1.34 2011/04/21 13:38:14 joerg Exp $");
+__RCSID("$NetBSD: pthread_cancelstub.c,v 1.35 2011/04/22 14:18:34 joerg Exp $");
#ifndef lint
@@ -472,6 +472,20 @@
}
ssize_t
+read(int d, void *buf, size_t nbytes)
+{
+ ssize_t retval;
+ pthread_t self;
+
+ self = pthread__self();
+ TESTCANCEL(self);
+ retval = _sys_read(d, buf, nbytes);
+ TESTCANCEL(self);
+
+ return retval;
+}
+
+ssize_t
readv(int d, const struct iovec *iov, int iovcnt)
{
ssize_t retval;