(Fwd) Re: SCSI tape data loss

Dan Nelson dnelson at allantgroup.com
Thu Aug 28 11:19:36 PDT 2003


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?

-- 
	Dan Nelson
	dnelson at allantgroup.com




More information about the freebsd-scsi mailing list