From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 8 12:38:32 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E286E16A4C0 for ; Mon, 8 Sep 2003 12:38:32 -0700 (PDT) Received: from bast.unixathome.org (bast.unixathome.org [66.11.174.150]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A28B43F93 for ; Mon, 8 Sep 2003 12:38:31 -0700 (PDT) (envelope-from dan@langille.org) Received: from wocker (wocker.unixathome.org [192.168.0.99]) by bast.unixathome.org (Postfix) with ESMTP id 849C43D28; Mon, 8 Sep 2003 15:38:24 -0400 (EDT) From: "Dan Langille" To: freebsd-hackers@FreeBSD.org Date: Mon, 08 Sep 2003 15:38:22 -0400 MIME-Version: 1.0 Message-ID: <3F5CA26E.18181.1574B67E@localhost> Priority: normal In-reply-to: <3F5B89B3.11367.112C1E2D@localhost> References: X-mailer: Pegasus Mail for Windows (v4.02a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body cc: Kern Sibbald Subject: Re: comments on proposed uthread_write.c changes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2003 19:38:33 -0000 On 7 Sep 2003 at 19:40, Dan Langille wrote: > On 7 Sep 2003 at 12:32, Daniel Eischen wrote: > > > On Sun, 7 Sep 2003, Dan Langille wrote: > > > > > A problem with pthreads and EOT has been identified. See PR 56274. It > > > was suggested the solution was probably just a matter of changing one of > > > the >0 tests to >=0 in uthread_write.c > > > > > > Any comments on that? > > > > I don't know that a return of 0 isn't valid for other devices. > > If this is the case, a return of 0 for blocking writes may break > > other applications. > > > > The patch isn't quite correct (at least looking at -current srcs). > > Lines 98-99 are: > > > > if (blocking && ((n < 0 && (errno == EWOULDBLOCK || > > errno == EAGAIN)) || (n >= 0 && num < nbytes))) { > > > > This will get entered first if n == 0, and I don't think your > > proposed patch would have any effect. I think you would have > > to change the "n >= 0" above to be "n > 0" in conjunction with > > your patch. > > Ahh thank you. That explains why the test results with the original > patch did not differ from -STABLE or 5.1-RELEASE. After adding your > suggestions, we have had success. Oh I was wrong, very wrong. The test code I ran had not been compiled with pthreads. Kern found my mistake after he was unable to reproduce my [false] results. It appears the problem is not with uthread_write.c... Or at least not in the areas we are changing. Suggestions? -- Dan Langille : http://www.langille.org/