[ECOS] Performance patch to termios code

Jonathan Larmour jlarmour@redhat.com
Thu Jan 10 12:51:00 GMT 2002

psheer@icon.co.za wrote:
> The termios code only reads one char at a time.
> This creates poor performance in many cases and is
> easy to fix.

Yes, it could maybe read everything into a buffer. But bear in mind that
the buffer may not be emptied after we must return, so it would need to be
persistent. That's completely separate from your patch though :-).

> The patch below causes read() to
> keep reading so long as there are still characters
> available that won't cause cause a block.
> I belive this is the correct behavior.

The termios driver only supports MIN=0,TIME=0 for non-canonical mode. It
looks like you are trying to implement MIN>0, TIME=0. But if so, this patch
will break the MIN=0 case. With MIN=0,TIME=0 "the minimum of either the
number of bytes requested or the number of bytes currently available shall
be returned without waiting for more bytes to be input" according to the

Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

More information about the Ecos-discuss mailing list