X-Spam-Check-By: sourceware.org
Date: Fri, 13 Apr 2007 15:02:14 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: SIGTSTP and select
Message-ID: <20070413190214.GB17273@ednor.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <20070403000723.GG24160@cox.net> <20070403003753.GA11244@ednor.casa.cgf.cx> <20070403141320.GA3459@cox.net> <20070413132501.GG15801@calimero.vinschen.de> <20070413140108.GA25914@cox.net> <20070413145136.GK15801@calimero.vinschen.de> <20070413150356.GA17273@ednor.casa.cgf.cx> <20070413151521.GD25914@cox.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20070413151521.GD25914@cox.net>
User-Agent: Mutt/1.5.14 (2007-02-12)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
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

On Fri, Apr 13, 2007 at 11:15:21AM -0400, Bob Rossi wrote:
>On Fri, Apr 13, 2007 at 11:03:56AM -0400, Christopher Faylor wrote:
>> >Ok, there's a difference between tty and notty mode here.  I can
>> >reproduce this with notty, while I get a -1/EINTR with CYGWIN=tty. 
>> >This is a bit unfortunate difference which is probably a result of
>> >different handling of console handles (notty) vs. pipe handles (tty).
>> >I'm not sure how to fix that.  Signals and select are rather Chris'
>> >contruction lot.
>> 
>> I'm not in a position to test this right now but, if cygwin is in
>> blocking mode, i.e., select is in an infinite wait, it should be
>> possible to use CTRL-Z to suspend it.  I will look into this once I have
>> my computers put back together.
>
>OK, thank you. The test case easily reproduces this behavior.
>
>What I'm really wondering is if I should hold up a release of cgdb over
>this. I could do one of several things
>  - wait to do a release until select is changed
>  - tell the user to use CYGWIN=tty if they want to do ctrl-z
>  - add my hack to fix this problem with the way things are

We have no plans on releasing a new version of Cygwin anytime soon.

>> >The restart behaviour as you observed on Linux is not implemented for
>> >select in Cygwin so far.  Only a few system calls actually implement
>> >this right now.  You should always handle EINTR yourself, as your loop
>> >already does.
>> >
>> >While that's not a nice solution in the long run, it might be better
>> >to ask the use to run cgdb with CYGWIN=tty for now (which is default
>> >in remote sessions, that's why I couldn't reproduce anything first).
>> >You could for instance add a cgdb wrapper script which always adds tty
>> >to $CYGWIN and starts the cgdb binary.
>> 
>> Or start gdb in a pty.
>
>Sorry, I'm not sure what you mean. If you are talking about the way cgdb
>starts gdb, yes, it uses a pty.

CTRL-Z works in a pty.  There is no difference between running under a pty
or running with CYGWIN=tty.

cgf

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

