This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem open(...) serial port /dev/com20 and tcgetattr(...)


Hello,

accessing serial port under cygwin, with ids above 10 is broken:

Using "/dev/com20" results in a "No such file or directory" error.

#include <unistd.h>
#include <fcntl.h>
#include <termios.h>

int main (int argument_count, char * arguments [])   
{   
    printf("opening com20:");
    int fd = open("/dev/com20", O_RDONLY | O_NONBLOCK);   
    perror(NULL);
    struct termios options;
    int result = tcgetattr(fd, &options);
    perror(NULL);   
}

The following post:
http://www.cygwin.com/ml/cygwin/1999-12/msg00323.html says I should use

"\\\\.\\com20" instead of "/dev/com20". If I do that, the call to open(...) succeed, 
but the call to tcgetattr raises a "Inappropriate ioctl for device" error.

I checked the example using "/dev/com3", and it works all right, so the
issue is limited to ports id above 9.

I already checked the following posts:
http://sourceware.org/ml/insight/2004-q4/msg00078.html, so it seems to
be a bug.

Do you have a workaround for this?

Kind regards,

Stan.

Attachment: signature.asc
Description: OpenPGP digital signature


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