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]

Re: tcgetattr problem


On 18:36 Wed 27 Sep     , Igor Peshansky wrote:
> 
> #define PORT "com1"
> ...
>   fd = open(PORT, O_RDWR | O_NOCTTY );
> 
> There's your problem.  When you open a port as "com1", it looks like a
> file to Cygwin, since it doesn't recognize it as a valid device name.
> Thus any attempt to manipulate that fd as a device will fail.
> 
> Use the Cygwin device (e.g., "/dev/ttyS0").

Strangely, com1 *does* work in the call to open. Having tried "/dev/ttyS0",
tcgetattr() works ok.

I also note that read() and write() work ok too using "com1", but
tcsetattr() also fails.

BTW, I obtained the CVS source, but couldn't find the _ioctl() call 
anywhere in my (brief) grepping. Is there any documentation about internal
structure, and whats going on under the hood?

regards,
ahnkle


--
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/


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