# Re: sane_read returning *len == 0

Chris Pinkham (cpinkham@infi.net)
Sun, 5 Apr 1998 20:01:59 -0400 (EDT)

- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
- Next message: Michael Polo: "Re: sane 0.72pre meets FreeBSD [my system of package control]"
- Previous message: David Mosberger-Tang: "Re: I donīt like that"
- In reply to: David Mosberger-Tang: "Re: sane_read returning *len == 0"
- Next in thread: Matto Marjanovic: "Re: sane_read returning *len == 0"

> Matto> Doesn't it matter whether or not the IO mode is set to
> Matto> blocking versus non-blocking? The spec states that in
> Matto> blocking mode, sane_read must return at least one byte of
> Matto> data for each call, blocking until it's got at least that one
> Matto> byte to give (otherwise, a front-end would have to keep
> Matto> polling, yuck --- non-blocking mode allows you to do a select
> Matto> on the device and wake up when data arrives).
>
> You're right---I must have been sleeping when searching for this
> clause, as I couldn't find it last night... ;-/
>
> --david

First of all, thanks for no-one responding "RTFM!" to me when I asked the
question to begin with. :) I had skimmed the docs before myself, but
didn't see anything. I just reread them, especially the section you are
referring to.

I had already gone in and modified my sane_read() function to operate in
blocking mode. The program also fills the buffer up to as close as
possible to max_len and reads as many lines as possible from the scanner
also, so the driver is a bit faster now. I'll submit a patch as soon as
I change/test a couple more things. Now if I could only fine someone
else with one of these things to test other than myself. :)

Chris
cpinkham@sh001.infi.net

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

- Next message: Michael Polo: "Re: sane 0.72pre meets FreeBSD [my system of package control]"
- Previous message: David Mosberger-Tang: "Re: I donīt like that"
- In reply to: David Mosberger-Tang: "Re: sane_read returning *len == 0"
- Next in thread: Matto Marjanovic: "Re: sane_read returning *len == 0"