Date: Sun, 31 Aug 2003 20:35:38 -0400 From: "Dan Langille" <dan@langille.org> To: Dan Nelson <dnelson@allantgroup.com> Cc: freebsd-scsi@freebsd.org Subject: Re: (Fwd) Re: SCSI tape data loss Message-ID: <3F525C1A.21504.35EB4B7E@localhost> In-Reply-To: <bilgkb$nk3$1@sea.gmane.org> References: <Pine.GSO.4.10.10308281338580.12975-100000@pcnet5.pcnet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F525C1A.21504.35EB4B7E>