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. I cannot comment on whether returns of 0 for blocking writes are valid in some cases or not. I would tend to be very careful because it's not something that is easily tested by running thread regression tests, kde, etc. This could be solved at the application level by selecting on the tape device and performing non-blocking writes to it. Since the application knows that a return of 0 is end-of-tape, it must also know the difference between talking to a tape device and talking to a regular file, socket, etc. -- Dan Eischen _______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"