Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Authentication-Warning: shadizar.dyndns.org: blackwolf set sender to mbarilli@midsouth.rr.com using -f
To: cygwin@cygwin.com
Subject: Re: Can't set CREAD flag on serial port?
References: <873c908a8q.fsf@shadizar.dyndns.org>
From: mbarilli@midsouth.rr.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  <mbarilli@midsouth.rr.com> 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: <http://shadizar.dyndns.org/> | 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/

