Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpthread Don't kill the read(2) stub, just the magic a...



details:   https://anonhg.NetBSD.org/src/rev/0fc66f194c51
branches:  trunk
changeset: 764440:0fc66f194c51
user:      joerg <joerg%NetBSD.org@localhost>
date:      Fri Apr 22 14:18:34 2011 +0000

description:
Don't kill the read(2) stub, just the magic around it.

diffstat:

 lib/libpthread/pthread_cancelstub.c |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 9b928b2abb81 -r 0fc66f194c51 lib/libpthread/pthread_cancelstub.c
--- a/lib/libpthread/pthread_cancelstub.c       Fri Apr 22 08:19:25 2011 +0000
+++ b/lib/libpthread/pthread_cancelstub.c       Fri Apr 22 14:18:34 2011 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index