Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Tue, 23 Aug 2005 15:08:59 -0400 (EDT)
From: Igor Pechtchanski <pechtcha@cs.nyu.edu>
Reply-To: cygwin@cygwin.com
To: pppd <pppd@terra.com.br>
cc: cygwin@cygwin.com
Subject: Re: 1.5.18 ( 0.132/4/2 ) - read() - blocks ( serial programming )
In-Reply-To: <ILORN5$C7D4FFDE38F892F439ED1145B171BFC3@terra.com.br>
Message-ID: <Pine.GSO.4.63.0508231506120.27271@slinky.cs.nyu.edu>
References: <ILORN5$C7D4FFDE38F892F439ED1145B171BFC3@terra.com.br>
MIME-Version: 1.0
Content-Type: MULTIPART/Mixed; BOUNDARY="_=__=_XaM3_.1124818673.2A.73709.42.17028.52.42.007.2058218701"
Content-ID: <Pine.GSO.4.63.0508231506121.27271@slinky.cs.nyu.edu>

--_=__=_XaM3_.1124818673.2A.73709.42.17028.52.42.007.2058218701
Content-Type: TEXT/PLAIN; CHARSET=iso-8859-1
Content-Transfer-Encoding: 8BIT
Content-ID: <Pine.GSO.4.63.0508231506122.27271@slinky.cs.nyu.edu>

On Tue, 23 Aug 2005, pppd wrote:

> Hello guys,
>
>        I´m working to convert a Linux application to work with Windows
> XP under Cygwin 1.5.18 ( 0.132/4/2 ). Ncurses package and parallel port
> programming works without changes ( congratulations ). I have a problem
> with serial programming.
>
> First, I did two C files: ( attached )
>
>        setcmc7.c - Sets serial configuration through Win32 API. ( Linux
> termios settings/functions doesn't work for me :-( ).
>        cmc7.c - Read caracters from serial.
>
> After setting serial configuration by setcmc7.c I can read serial port
> using cmc7.
>
> My doubt is: Why read() function blocks the terminal (keyboard) until
> read a caracter ? At Linux it's work fine ( same code ).
>
> My application needs to read keyboard at the same time with serial.
> I have tried some flags with open ( O_NONBLOCK, O_NDELAY .. )
> unfortunately doesn't work too.
>
> Does anybody can help me please?

I doubt the same code works on Linux, since open("COM1") will fail there.
You need to open something that Cygwin knows is a serial port, i.e.,
"/dev/ttyS0" (or "/dev/com1", but not "COM1").

Plus, you can probably write setcmc7.c using Cygwin calls as well (instead
of Win32, that is).
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA

--_=__=_XaM3_.1124818673.2A.73709.42.17028.52.42.007.2058218701
Content-Type: text/plain; charset=us-ascii

--
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/
--_=__=_XaM3_.1124818673.2A.73709.42.17028.52.42.007.2058218701--
