This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Cygwin parenting issue


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]