This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: short reads on serial port..
- To: Dave Airlie <airlied at parthus dot com>
- Subject: Re: [ECOS] short reads on serial port..
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Thu, 26 Oct 2000 20:16:58 +0100
- CC: ecos-discuss at sources dot redhat dot com
- Organization: Red Hat UK Ltd.
- References: <Pine.LNX.4.21.0010261803210.6680-100000@platinum.limerick.sslinc.com>
Dave Airlie wrote:
>
> Does eCos support short reads? .. I want to read from the serial port for
> a max len of 127 bytes, but if there is nothing there I want to
> block until something appears .... I suppose I want to use select. .. but
> I don't want to use select :-).....
>
> Should I use select, what does it drag in the way of extra stuff to my
> build ... I don't want to have to add POSIX stuff really...
>
> Is there another way?
Um, serial reads do block by default. If you want to wait on multiple
devices but avoid select, you could use multiple threads using blocking
reads, which then signal your original thread when data arrives.
Jifl
--
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow." || These opinions are all my own fault