cygwin 1.5.23-2 : I can't use select() with serial device and socket

Florent Morin morinflorent@gmail.com
Thu Jan 18 17:02:00 GMT 2007


I use unix names. I will post an example code tomorrow.

2007/1/18, Brian Dessent <brian@dessent.net>:
> Florent Morin wrote:
>
> > I have a problem using cygwin. My program does this :
> > - It accept a socket connection,
> > - it listen on it,
> > - it open serial device read/write (O_RDWR),
> > - it create 2 fd_sets,
> > - listening loop :
> >   - adding file descriptors to sets,
> >   - call select(),
> >   - if something is on serial port, I write it to socket,
> >   - if something is on socket, i write it to serial
> >
> > It works fine on Linux.
> >
> > With windows, only read or write works fine.
> >
> > If I begin on reading on serial, I can't write after (access denied).
> > If I begin on writing on serial, I can't read after (access denied).
>
> There's probably not enough information here to help.  It would be
> easier if you provided a simplified standalone testcase that we can
> compile and run.  Are you opening the serial device using the standard
> unix name (/dev/ttyS0) and not the DOS name ("COM1")?  The latter will
> succeed but probably not work with things like ioctl or select, because
> in order to emulate those APIs Cygwin has to know to treat the handle
> specifically as a serial device, which it only does if you open it using
> the unix form.
>
> Brian
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>
>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list