From owner-freebsd-bugs Thu May 2 12:10:15 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 1B52437B419 for ; Thu, 2 May 2002 12:10:03 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g42JA3d89718; Thu, 2 May 2002 12:10:03 -0700 (PDT) (envelope-from gnats) Date: Thu, 2 May 2002 12:10:03 -0700 (PDT) Message-Id: <200205021910.g42JA3d89718@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Archie Cobbs Subject: Re: bin/37658: libc_r: poll(2) does not wake up when thread canceled Reply-To: Archie Cobbs Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/37658; it has been noted by GNATS. From: Archie Cobbs To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: bin/37658: libc_r: poll(2) does not wake up when thread canceled Date: Thu, 2 May 2002 12:03:00 -0700 (PDT) Here is the corresponding patch for -current. -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com Index: uthread_poll.c =================================================================== RCS file: /home/ncvs/src/lib/libc_r/uthread/uthread_poll.c,v retrieving revision 1.11 diff -u -r1.11 uthread_poll.c --- uthread_poll.c 10 Apr 2001 04:19:20 -0000 1.11 +++ uthread_poll.c 2 May 2002 18:58:14 -0000 @@ -41,7 +41,7 @@ #include #include "pthread_private.h" -__weak_reference(_poll, poll); +__weak_reference(__poll, poll); int _poll(struct pollfd *fds, unsigned int nfds, int timeout) @@ -96,4 +96,16 @@ } return (ret); +} + +int +__poll(struct pollfd *fds, unsigned int nfds, int timeout) +{ + int ret; + + _thread_enter_cancellation_point(); + ret = _poll(fds, nfds, timeout); + _thread_leave_cancellation_point(); + + return ret; } Index: uthread_readv.c =================================================================== RCS file: /home/ncvs/src/lib/libc_r/uthread/uthread_readv.c,v retrieving revision 1.13 diff -u -r1.13 uthread_readv.c --- uthread_readv.c 10 Apr 2001 04:19:20 -0000 1.13 +++ uthread_readv.c 2 May 2002 18:58:14 -0000 @@ -40,7 +40,7 @@ #include #include "pthread_private.h" -__weak_reference(_readv, readv); +__weak_reference(__readv, readv); ssize_t _readv(int fd, const struct iovec * iov, int iovcnt) @@ -91,4 +91,16 @@ _FD_UNLOCK(fd, FD_READ); } return (ret); +} + +ssize_t +__readv(int fd, const struct iovec *iov, int iovcnt) +{ + ssize_t ret; + + _thread_enter_cancellation_point(); + ret = _readv(fd, iov, iovcnt); + _thread_leave_cancellation_point(); + + return ret; } Index: uthread_select.c =================================================================== RCS file: /home/ncvs/src/lib/libc_r/uthread/uthread_select.c,v retrieving revision 1.19 diff -u -r1.19 uthread_select.c --- uthread_select.c 9 Apr 2002 05:41:00 -0000 1.19 +++ uthread_select.c 2 May 2002 18:58:14 -0000 @@ -43,7 +43,7 @@ #include #include "pthread_private.h" -__weak_reference(_select, select); +__weak_reference(__select, select); int _select(int numfds, fd_set * readfds, fd_set * writefds, fd_set * exceptfds, @@ -213,4 +213,17 @@ } return (ret); +} + +int +__select(int numfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, + struct timeval *timeout) +{ + int ret; + + _thread_enter_cancellation_point(); + ret = _select(numfds, readfds, writefds, exceptfds, timeout); + _thread_leave_cancellation_point(); + + return ret; } Index: uthread_wait4.c =================================================================== RCS file: /home/ncvs/src/lib/libc_r/uthread/uthread_wait4.c,v retrieving revision 1.13 diff -u -r1.13 uthread_wait4.c --- uthread_wait4.c 10 Apr 2001 04:19:20 -0000 1.13 +++ uthread_wait4.c 2 May 2002 18:58:14 -0000 @@ -38,7 +38,7 @@ #include #include "pthread_private.h" -__weak_reference(_wait4, wait4); +__weak_reference(__wait4, wait4); pid_t _wait4(pid_t pid, int *istat, int options, struct rusage * rusage) @@ -67,4 +67,16 @@ _thread_kern_sig_undefer(); return (ret); +} + +pid_t +__wait4(pid_t pid, int *istat, int options, struct rusage *rusage) +{ + pid_t ret; + + _thread_enter_cancellation_point(); + ret = _wait4(pid, istat, options, rusage); + _thread_leave_cancellation_point(); + + return ret; } Index: uthread_writev.c =================================================================== RCS file: /home/ncvs/src/lib/libc_r/uthread/uthread_writev.c,v retrieving revision 1.18 diff -u -r1.18 uthread_writev.c --- uthread_writev.c 10 Apr 2001 04:19:20 -0000 1.18 +++ uthread_writev.c 2 May 2002 18:58:14 -0000 @@ -42,7 +42,7 @@ #include #include "pthread_private.h" -__weak_reference(_writev, writev); +__weak_reference(__writev, writev); ssize_t _writev(int fd, const struct iovec * iov, int iovcnt) @@ -201,4 +201,16 @@ free(p_iov); return (ret); +} + +ssize_t +__writev(int fd, const struct iovec *iov, int iovcnt) +{ + ssize_t ret; + + _thread_enter_cancellation_point(); + ret = _writev(fd, iov, iovcnt); + _thread_leave_cancellation_point(); + + return ret; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message