delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/01/01/16:02:18

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:message-id:date:mime-version
:content-type:content-transfer-encoding; q=dns; s=default; b=fhg
dXu+t/0EQTTCioVDhfUx//Vq8LCpx1+UUryXqAaRddMktNOpoN9b2yfTRB/4oxeu
b8y75miHZ28JhDMnZQoDPfEIZC/+WFtsDompNxe0wHVV6QjCqwd/rn8vHolPdalp
dvUBtdkPlaSMG8nzQSkW3YFzzEwMVB/nZ9CLaTpw=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:message-id:date:mime-version
:content-type:content-transfer-encoding; s=default; bh=VfwKbnsHE
J51NCfiy8DOVIm7+W0=; b=dm3Bbks7Hcoa5ZHYEMGFU5wwwXtTza6Tq4F90FQCg
/JfSLUhjf1B/zmwFuTw1Qmp1FKJJxxv/61ljBVh+t5v2wf0wxa4Knv51l4oXY/zF
iYOiTknLb7u5mST1iYR18ZLaLE0Cz4Fe10L6MnubpfMZKZBSnUMLDlUnnXTTl1KJ
oQ=
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
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=H*MI:edu, H*c:alternative, documents
X-HELO: endymion.arp.harvard.edu
To: cygwin AT cygwin DOT com
From: Norton Allen <allen AT huarp DOT harvard DOT edu>
Subject: Cygwin parenting issue
Message-ID: <7cb7cef9-0e4b-8e9d-0c14-ffe3e9e79a13@huarp.harvard.edu>
Date: Wed, 1 Jan 2020 16:01:00 -0500
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1
MIME-Version: 1.0
X-IsSubscribed: yes

I have a project that involves starting a number of programs in the 
background and then monitoring and reporting when they terminate. My 
approach has been to write a small application called 'parent' that 
loops on waitpid() until there are no more children. I invoke it in a 
script like:

#! /bin/bash
program1 &
program2 &
program3 &
exec parent

This of course works under Linux, but under Cygwin, although 'ps' 
documents the parent/child relationship, waitpid() immediately returns 
ECHILD, indicating there are no child processes. If I use the shell's 
waitpid, that works alright, so I am wondering whether the problem is a 
casualty of the exec.

I have a minimal test setup at 
https://github.com/nthallen/test_parenting, along with examples showing 
how it works under Linux and Cygwin.

Is this something that we would expect to work under Cygwin?

-Norton


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