This is the mail archive of the cygwin@sourceware.cygnus.com 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]

RE: jed update & ksh attempt


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@cygnus.com" with one line of text: "help".


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