Date: Mon, 08 Sep 2003 15:38:22 -0400 From: "Dan Langille" <dan@langille.org> To: freebsd-hackers@FreeBSD.org Cc: Kern Sibbald <kern@sibbald.com> Subject: Re: comments on proposed uthread_write.c changes Message-ID: <3F5CA26E.18181.1574B67E@localhost> In-Reply-To: <3F5B89B3.11367.112C1E2D@localhost> References: <Pine.GSO.4.10.10309071218420.11986-100000@pcnet5.pcnet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F5CA26E.18181.1574B67E>