delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/06/16/17:04:22

From: cgf AT bbc DOT com (Chris Faylor)
Subject: Re: Sergey's latest cygwin.dll and pdksh
16 Jun 1997 17:04:22 -0700 :
Sender: mail AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <EBvzCI.653.cygnus.gnu-win32@bbc.com>
References: <01BC7A72 DOT D9971970 AT gater DOT krystalbank DOT msk DOT ru>
Reply-To: cgf AT bbc DOT com
X-Newsreader: trn 4.0-test57 (27 Apr 97)
Original-To: gnu-win32 AT cygnus DOT com
X-Mailer: Perl5 Mail::Internet v1.28
Original-Sender: owner-gnu-win32 AT cygnus DOT com

In article <01BC7A72 DOT D9971970 AT gater DOT krystalbank DOT msk DOT ru>,
Sergey Okhapkin  <sos AT prospect DOT com DOT ru> wrote:
>Chris Faylor wrote:
>> >It's easy for me to fix this bug, if anyone will answer my question -
>> >should sigsuspend() (and the others blocking calls) terminate when
>> >receiving blocked or uncatched signal?
>>
>> Sergey,
>> If I run the code below on a variety of UNIX systems and tell you how it
>> works, will that answer your question?
>>
>> #include <signal.h>
>> main()
>> {
>>     sigset_t nada = 0L;
>>     if (fork() == 0) {
>> 	sleep(2);
>> 	exit(0);
>>     }
>>
>>     sigsuspend(&nada);
>>     puts("returned");
>>     exit(0);
>> }
>>
>> FYI, I ran this on one system here (Digital UNIX 3.2C) and it blocked
>> forever.  If this isn't quite right, then, if it is possible, could you
>> modify this (or throw it away and start from scratch) to show the answer
>> to your question?
>
>I've tried something like it on linux with the same result - blocked, 
>ignored or uncatched signals with ignore as a default disposition, does not 
>terminates wait calls. So, I have no ideas now why zsh's SIGCHLD behavior  
> differs on unixes and on cygwin...

Just so we're on the same wavelength, this is the relevant code from zsh:

----

#ifdef POSIX_SIGNALS
    struct sigaction act;

    act.sa_handler = (SIGNAL_HANDTYPE) handler;
    sigemptyset(&act.sa_mask);        /* only block sig while in handler */
    act.sa_flags = 0;
# ifdef SA_INTERRUPT                  /* SunOS 4.x */
    if (interact)
        act.sa_flags |= SA_INTERRUPT; /* make sure system calls are not restarte
d */
# endif
    sigaction(sig, &act, (struct sigaction *)NULL);

----

Where the 'sig' is 'SIGCHLD'.

It appears that 'sig' is blocked while within the handler.  Could that be
what is going wrong?
-- 
http://www.bbc.com/	cgf AT bbc DOT com			"Strange how unreal
VMS=>UNIX Solutions	Boston Business Computing	 the real can be."
-
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