Date: Mon, 01 Sep 2003 11:19:20 -0400 From: "Dan Langille" <dan@langille.org> To: freebsd-scsi@freebsd.org Cc: Kern Sibbald <kern@sibbald.com> Subject: Re: (Fwd) Re: SCSI tape data loss Message-ID: <3F532B38.27815.39145AAE@localhost> In-Reply-To: <3F525C1A.21504.35EB4B7E@localhost> References: <bilgkb$nk3$1@sea.gmane.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 31 Aug 2003 at 20:35, Dan Langille wrote: > 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? Done: 56274 => http://www.freebsd.org/cgi/query-pr.cgi?pr=56274 -- Dan Langille : http://www.langille.org/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F532B38.27815.39145AAE>