re: Changes in the sockets: SIGIO handling

From: Dean Gaudet (dgaudet-list-linux-kernel@arctic.org)
Date: Mon Mar 06 2000 - 11:46:14 EST


On Fri, 3 Mar 2000, Stephen C. Tweedie wrote:

> If you use poll, and you fail to read all the data which is available,
> then next time you poll you'll find the fd still active. If you rely on
> signals, then it is up to you to make sure that you do all of the work
> specified by the signal, and that absolutely requires that you keep
> reading until there is no more data on the fd.

hmm. i think you only need to loop around and continue read()ing if
the first read() returned a full buffer. this should save a bunch
of extra read() == -1/EWOULDBLOCK returns. i.e. if you asked for 4096
and got 1400 then you don't need to read() again -- 'cause the next
packet will queue up another signal.

Dean

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:20 EST