This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Newbie question regarding tcsetattr
- From: Roger Pryor <rpryor at pryor-and-pryor dot com>
- To: Cygwin Mailing List <cygwin at cygwin dot com>
- Date: Fri, 19 Nov 2004 13:15:23 -0800
- Subject: Newbie question regarding tcsetattr
- Organization: Pryor and Pryor Inc.
Hi:
I'm a new cygwin user, attepting to port a Linux package that uses the COM
ports to drive a remote device. I'm finding that calls to tcsetattr don't
seem to work. What is happening is that although the speed is being
setup correctly, the values that I want for c_iflag and c_cflag are not
being set, but left as they were before. Is this a known bug (there were
conversations about this last year in the archives) and if so is there any
idea when it will be fixed?, or am I confused (equally likely!)
Usage is:
...
int port;
struct termios p;
...
port = open("/dev/ttyS1", O_RDWR|O_NOCTTY|O_NDELAY);
...
memset(&p, 0, sizeof(struct termios));
p.c_iflag = IGNBRK|IGNPAR;
p.c_cflag = CS8|CREAD|CLOCAL|B9600;
cfsetispeed(&p, B9600);
cfsetospeed(&p, B9600);
if(tcsetattr(port, TCSANOW, &p) < 0)
grumble
Thanks
--------------------------------------------------------------------------
Roger Pryor
Vancouver, B.C., V6E 1K7, Canada
--
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/