Re: sane_read returning *len == 0

Matto Marjanovic (maddog@mir.com)
Fri, 3 Apr 1998 13:50:04 -0500 (EST)

>>>>> On Thu, 2 Apr 1998 12:35:58 -0500 (EST), Chris Pinkham <cpinkham@billing.infi.net> said:

Chris> I am wondering what the defined action/status of sane_read()
Chris> should be if when it returns, the *len == 0. Is this
Chris> considered an error?

No. It simply means that no data is available.

Doesn't it matter whether or not the IO mode is set to blocking versus
non-blocking? The spec states that in blocking mode, sane_read must
return at least one byte of data for each call, blocking until it's got
at least that one byte to give (otherwise, a front-end would have to
keep polling, yuck --- non-blocking mode allows you to do a select on
the device and wake up when data arrives).

So, if your backend is doing the simple blocking mode only, it *should*
keep reading from from scanner until it has something to return to the
frontend.

-matt m.

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com