X-Recipient: archive-cygwin@delorie.com X-Spam-Check-By: sourceware.org Message-ID: <182dc94a0810020300l57d1bcacw1dfc6a42e98d5611@mail.gmail.com> Date: Thu, 2 Oct 2008 15:30:18 +0530 From: "Mani kandan" To: cygwin@cygwin.com Subject: Urgent !!! Need details about signal in cygwin MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Delivered-To: mailing list cygwin@cygwin.com Hi, We use the signal(SIGCHLD,sample) to get the status of the child process according which we do further processing. following is the sample function void sample(int signo) { char *funcName = "sample()"; int s = 0; int a = -1; int get_pid_indx; int pid = 0; int Debug = 0; if ( (pid = waitpid(anypid, NULL, WNOHANG) ) <= 0) { if (Debug) cout << funcName << ": pid <= 0 : " << pid << endl; } else { if (Debug) cout << funcName << ": pid > 0 : " << pid << endl; if ( (get_pid_indx = lstOutStandingPids.index(&pid)) != 0) { int *ptr_pid = new int; *ptr_pid = pid; lstCompletedPids.insert(ptr_pid); ptr_pid = lstOutStandingPids.removeAt(get_pid_indx); delete ptr_pid; } } signal(SIGCHLD, sample); return; } and also we also have a doubt that shall we use signal(SIGCLD,SIG_DFL) in cygwin?? Pls Kindly advice VM -- 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/