Date: Thu, 28 Aug 2003 13:11:19 -0500 From: Dan Nelson <dnelson@allantgroup.com> To: freebsd-scsi@freebsd.org Subject: Re: (Fwd) Re: SCSI tape data loss Message-ID: <bilgkb$nk3$1@sea.gmane.org> In-Reply-To: <Pine.GSO.4.10.10308281338580.12975-100000@pcnet5.pcnet.com> References: <Pine.GSO.4.10.10308271433560.15517-100000@pcnet5.pcnet.com> <Pine.GSO.4.10.10308281338580.12975-100000@pcnet5.pcnet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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@allantgroup.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bilgkb$nk3$1>
