Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: shadizar.dyndns.org: blackwolf set sender to mbarilli AT midsouth DOT rr DOT com using -f To: cygwin AT cygwin DOT com Subject: Re: Can't set CREAD flag on serial port? References: <873c908a8q DOT fsf AT shadizar DOT dyndns DOT org> From: mbarilli AT midsouth DOT rr DOT com Date: Tue, 24 Feb 2004 20:30:12 -0600 In-Reply-To: <873c908a8q.fsf@shadizar.dyndns.org> (mbarilli@midsouth.rr.com's message of "Tue, 24 Feb 2004 14:59:17 -0600") Message-ID: <87y8qr7ux7.fsf@shadizar.dyndns.org> User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes >>>>> "me" == mbarilli writes: me> I'm trying to write an application to access a serial port on me> a Windows 2000 box, but the CREAD flag doesn't stay set when I me> do `tcsetattr' and check the values with `tcgetattr'. Trying me> to read from the port returns a ``Resource temporarily me> unavailable'' error (as generated from perror). me> ... me> tty_fd = open("/dev/com2",O_RDWR|O_NDELAY|O_BINARY); Doh. Guess that's what I get for cargo-cult programming and not reading the flags I'm passing to `open'. Of course I'll get an error of EAGAIN if I open the port in non-blocking mode (O_NDELAY) and there's nothing available on the wire. The CREAD flag issue was a red herring, apparently. Sorry 'bout that ... -- Michael J. Barillier | ``Those who make peaceful email: mbarilli(at)midsouth.rr.com | revolution impossible will make web: | violent revolution inevitable.'' Public key available on request. | -- John F. Kennedy -- 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/