delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/10/20/17:21:49

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_00,SPF_NEUTRAL,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4CBF5D5F.7070603@cornell.edu>
Date: Wed, 20 Oct 2010 17:21:35 -0400
From: Ken Brown <kbrown AT cornell DOT edu>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Sending signals to a subprocess
References: <20101018183438 DOT GA25878 AT ednor DOT casa DOT cgf DOT cx> <4CBCA2A5 DOT 4010601 AT cornell DOT edu> <20101018201805 DOT GA26254 AT ednor DOT casa DOT cgf DOT cx> <4CBD9DF2 DOT 3090804 AT cornell DOT edu> <20101019141557 DOT GA31784 AT ednor DOT casa DOT cgf DOT cx> <4CBE5F53 DOT 30402 AT cornell DOT edu> <AANLkTikUc9i0h-g3QHGzqKKRGoJf0-xSPgu6wy1U+zZ=@mail.gmail.com> <4CBED0C3 DOT 6080001 AT cornell DOT edu> <AANLkTinoRNBvUpiCGpVWXKLh4kYtyF=USrVhSuOX7_18 AT mail DOT gmail DOT com> <AANLkTi=RPo4mvZzB_NTwwJ_2tX_R4OcjPLH6M5==4VrW AT mail DOT gmail DOT com> <20101020203254 DOT GA11903 AT ednor DOT casa DOT cgf DOT cx>
In-Reply-To: <20101020203254.GA11903@ednor.casa.cgf.cx>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 10/20/2010 4:32 PM, Christopher Faylor wrote:
> On Wed, Oct 20, 2010 at 08:25:37PM +0100, Andy Koppe wrote:
>> On 20 October 2010 13:20, Andy Koppe wrote:
>>>> Corinna made tcgetpgrp return 0 instead of -1 in some circumstances
>>>> (see http://www.cygwin.com/ml/cygwin-patches/2009-q4/msg00045.html)
>>>> because she saw Linux doing that.  ??But when I run Corinna's test on
>>>> my Linux system, I get -1 where she got 0.  ??So not all Linuxes agree
>>>> on what tcgetpgrp should do.
>>>
>>> Hmm, Corinna's test calls tcgetpgrp(master) in the parent only before
>>> the child is forked and after it exited, so it's correct to report that
>>> there's no foreground process.
>>>
>>> I wonder which Linux it was that returned 0 in case of failure.  I've
>>> tried it on a recent Opensuse, an old Redhat with a 2.6.9 kernel, and
>>> also a Debian with a 2.4 kernel, and got -1 on all of those.
>>
>> Actually I'd only tried my test on all three systems, whereas I'd tried
>> Corinna's only on the old Redhat, where it did print -1 for failure.
>> On the 2.4 system it can't open /dev/ptmx, whereas on the Opensuse with
>> 2.6.34 I do get the results Corinna reported, including 0 on the master
>> side of the pty when enquiring from the parent.  (Process 0 is the
>> startup process, so I guess that makes some sense.)
>>
>> To bring my ramblings to some sort of conclusion, here's a slightly
>> amended version of Corinna's test that checks the master side from the
>> parent process before, *during* and after the child process:
>
> FYI, I'm sticking with the test case that I first posted several days
> ago and which has been cruelly ignored ever since.  I've been slowly
> modifying it for the last several days.

I didn't ignore it.  I just didn't know how to modify it to deal with 
subprocesses, which was the situation I was trying to understand.

> I think I'm seeing some pattern to the way Linux handles this and I should
> be able to make Cygwin work the same way.

That would be great.  Thanks.

> Just in case it isn't clear, this all has nothing, AFAICT, to do with the
> fact that Cygwin doesn't implement TIO[CS]PGRP but I have implemented those
> two ioctl's nonetheless.

It's clear, and I agree.

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019