delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/06/16/02:50:26

From: sos AT prospect DOT com DOT ru (Sergey Okhapkin)
Subject: RE: jed update & ksh attempt
16 Jun 1997 02:50:26 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <01BC7A46.3C1D16D0.cygnus.gnu-win32@gater.krystalbank.msk.ru>
Original-To: "gnu-win32 AT cygnus DOT com" <gnu-win32 AT cygnus DOT com>,
"'cgf AT bbc DOT com'"
<cgf AT bbc DOT com>
Encoding: 56 TEXT
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Chris Faylor wrote:
> >
> >> >From the pdksh source:
> >> 	/* Make sure SIGCHLD isn't ignored - can do odd things under SYSV */
> >> 	setsig(&sigtraps[SIGCHLD], SIG_DFL, SS_RESTORE_ORIG|SS_FORCE);
> >> So my guess is in answer to your question probably yes.
> >
> >"Probably"... I need the exact answer!
>
> By the way, as far as zsh is concerned, the answer is YES.  SIGCHLD is
> definitely trapped but appears to not be raised in zsh when a child 
process
> exits.

Every cygwin's process makes "kill(ppid, SIGCHLD)" before terminating. Look 
at _exit() code in dcrt0.cc. I just tried the following code on Linux box:

#include <signal.h>

main()
{
        sigset_t mask=0;

        signal(SIGCHLD, SIG_DFL);
        for(;;) {
                sigsuspend(&mask);
                printf("Trap!\n");
        }
}

I ran this program I tried to kill it with SIGCHLD. Sigsuspend() didn't 
terminates! The following code reports about SIGCHLD delivering:

#include <signal.h>

void handler(sig)
{
        signal(SIGCHLD, handler);
}

main()
{
        sigset_t mask=0;

        signal(SIGCHLD, handler);
        for(;;) {
                sigsuspend(&mask);
                printf("Trap!\n");
        }
}

--
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia
Looking for a job.


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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