Re: Blocking read() from a USB->Serial adapter.



On 2006-11-25, Grant Edwards <grante@xxxxxxxx> wrote:
On 2006-11-25, Floyd L. Davidson <floyd@xxxxxxxxxx> wrote:
Grant Edwards <grante@xxxxxxxx> wrote:
On 2006-11-25, Charles Sullivan <cwsulliv@xxxxxxxxxxxx> wrote:

If that's the case, then that answers my questions. I thought
blocking meant blocking until the specified number of
characters is read, or until the read is interrupted.

Or until the driver decides to return for whatever reason it
chooses. On success, you're guaranteed a minimum of one byte.

Maybe. (Maybe not too!)

There's the case where the file is at EOF. Is there another
case where read() will return success with 0 bytes?

AIUI EOF is not success.

a break symbol (or framing error etc...) on the seriai line
will also cause read to return.


--

Bye.
Jasen
.



Relevant Pages

  • Re: Blocking read() from a USB->Serial adapter.
    ... blocking meant blocking until the specified number of ... Or until the driver decides to return for whatever reason it ... On success, you're guaranteed a minimum of one byte. ...
    (comp.os.linux.development.apps)
  • Re: New Driveway
    ... || dropped kerb doesn't actually lead anywhere. ... The reason to stop other people blocking a persons ... Then you possibly have never lived in a street where there was already too little parking to go around, before people started paying for dropped curbs - effectively "buying" their bit of highway. ...
    (uk.legal)
  • Re: Sockets in C on Linux
    ... has (for some reason) stopped reading/writing the socket. ... use either alarm() (looks relatively simple but isn't ... really) or select/polland non-blocking sockets ). ... using alarmand blocking calls, ...
    (comp.programming)
  • Re: New Driveway
    ... || there was some consensus that the law has had the unintended effect ... The reason to stop other people blocking a persons ...
    (uk.legal)
  • Re: Should shared _r libraries depend on threading library?
    ... such that there is less blocking. ... Another reason is the ability to take advantage of multiple CPU cores. ... The majority of machines being sold today have more than one core. ... majority of machines sold two years ago had but one. ...
    (comp.programming.threads)