On Feb 3 09:52, llandre wrote: > > >> I'm trying to manipulate the DTR signal of the serial port. > >> As an example I used this code snippet: > >> http://lists.exploits.org/upsdev/Feb2004/00013.html. > >> I can open the com1, I can send and receive data but the ioctl I use > >> to read the status of the signals returns -1: > >> > >> int status; > >> ioctl(upsfd, TIOCMGET, &status); > >> > >> Anybody can help me? I have no idea about what's wrong with this code. > > > >strace would give a hint. TIOCMGET should only fail because a call to > >GetCommModemStatus fails. If so, the strace would contain a line which > >talks about setting errno in fhandler_serial::ioctl. > > Corinna, > > thanks a lot for your advice. > I tried to use strace. Here is what I see:
That's not enough information, so I try an educated guess. It looks like the file you opened is not recognized as serial interface. What did you use as device name? FYI, it should be either "/dev/com1" or /dev/ttyS0" for the first serial. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader mailto:cygwin@cygwin.com Red Hat, Inc. -- 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/