This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How to use cyg_io_select


Franck MAMALET FT-R&D DIH/OCF wrote:
> 
> >
> > I'm not entirely clear on your problem but anyway.
> >
> >>   But since you say you want a non-blocking read, I don't know quite
> >> why
> >>   there would be anything that needed waking up!
> >
> Sory it wasn't clear, hope this will be better:
>      I want a blocking read when no data is available, and a non-blocking
> read as regards to the number of byte to read (I want to be woken up when
> I can read 1 or more byte, and I don't want to call read once and get all
> bytes available).

Ah so you intend to use select to do the "blocking read". Fair enough. The
answer is then as I said to use open/read/write to access the devices,
rather than the cyg_io_* functions. That allows you to use select.
 
> > For the thread to wake
> > up, it must have been blocked waiting in select(). That means having
> > opened
> > and used the serial devices using open/read/write, and not cyg_io.
> > cyg_io_select() is the select file operation, it isn't actually an
> > equivalent of select().
> 
> Does this mean I need Posix Package to be able to wake-up my thread (the
> file package/io/fileio/current/test/select.c begins with "POSIX package
> needed to run test")?

As it says, you need the POSIX package to run the *test*.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]