X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: "Alex Vinokur" Subject: Signals, parent & children processes Date: Fri, 2 Dec 2005 18:26:56 +0200 Lines: 52 Message-ID: X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com ----------------------- CYGWIN_NT-5.0 1.5.18 Windows 2000 ---------------------- /* --------------------- */ void sigINT_handler1 (int sig_i) { fprintf (stderr, "sigINT_handler1: pid#%d ignores a signal %d\n", getpid(), sig_i); signal (SIGINT, sigINT_handler1); } void sigINT_handler2 (int sig_i) { fprintf (stderr, "sigINT_handler2: pid#%d ignores a signal %d\n", getpid(), sig_i); signal (SIGINT, sigINT_handler2); } int main() // fragments of code { sigINT_handler1 (SIGINT); if (fork() > 0) // Parent { // Stuff waitpid (pid, &status, 0); } else // Child { sigINT_handler2 (SIGINT); execvp (); } } Parent catchs SIGINT via sigINT_handler1, but Child doesn't catch SIGINT via sigINT_handler2. How can Child catch SIGINT with its own signal handler? -- Alex Vinokur email: alex DOT vinokur AT gmail DOT com http://mathforum.org/library/view/10978.html http://sourceforge.net/users/alexvn -- 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/