(Fwd) Re: SCSI tape data loss
Dan Langille
dan at langille.org
Sun Aug 31 17:34:20 PDT 2003
On 28 Aug 2003 at 13:11, Dan Nelson wrote:
> Daniel Eischen wrote:
> > Can I ask a question? When writing to a character/block special file
> > in non-blocking mode, are there any instances where 0 can be returned
> > from the write() other than when writing to a tape device?
> >
> > The only way I can see to fix this in libc_r is to fstat() the
> > descriptor when the threads library initializes it (uthread_fd.c)
> > and save st_mode for that fd. Then in write() check to see if
> > it is S_ISCHR() or S_ISBLK() and 0 was returned. It could
> > break out of write() if that was the case and return 0 to
> > the caller. But this doesn't work if you can get 0 back
> > from a write to other devices.
>
> I would be inclined to always pass a zero return from read or write back
> to the application; doesn't a read/write on a nonblocking device return
> EAGAIN if there's nothing to do?
Should a PR be opened?
--
Dan Langille : http://www.langille.org/
More information about the freebsd-scsi
mailing list