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 Date: Thu, 25 Mar 2004 13:37:24 +0000 (GMT) From: Ghanshyam To: cygwin AT cygwin DOT com Subject: RE:RE: 1.5.5.1 posix conformance for sigaction() Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII hi, Thanks for your attention. But I found the second result (two SIGCHLD) in both the cases. I m using the cygwin version 1.5.5.1 Thanks, Ghanshyam > -----Original Message----- > From: Christopher Faylor [mailto:cgf-no-personal-reply-please AT cygwin DOT com] > Sent: Wednesday, March 24, 2004 10:13 PM > To: cygwin AT cygwin DOT com > Subject: Re: 1.5.5.1 posix conformance for sigaction() > > On Wed, Mar 24, 2004 at 08:24:34PM +0000, Ghanshyam wrote: > >Hi all, > > > >I found some problem in sigaction() system call with respect to following > >assertions defined in IEEE std 2003.1 -1992 Test methods for measuring > >conformance to POSIX-part1 document: When I run NIST-PCTS test suite on > >cygwin the following assertion failed. > > > >14(C) If the behavior associated with {_POSIX_JOB_CONTROL} is > supported: > > When sig is SIGCHLD and the SA_NOCLDSTOP flag is set in sa_flags, > then a > > call to sigaction(sig, act, oact) results in a SIGCHLD signal not > > being generated for the parent process whenever any of its child > > processes stop. > > > >********** SIGCHLD signal received by parent process when SIGSTOP signal > >is send to child process! > > I have employed a patented method that I have devised called "a simple > test case" to determine if your claim is true or not. > > #include > #include > #include > #include > > void > ouch (int sig) > { > printf ("ouch %d\n", sig); > } > > int > main (int argc, char **argv) > { > struct sigaction newact = {0}; > struct sigaction oldact; > int pid, x; > > if (argc == 1) > newact.sa_flags = SA_NOCLDSTOP; > newact.sa_handler = ouch; > printf ("%d = sigaction\n", sigaction (SIGCHLD, &newact, &oldact)); > if ((pid = fork ()) > 0) > kill (pid, SIGSTOP); > else > { > sleep (5); > sleep (1); > puts ("exiting child\n"); > exit (0); > } > sleep (1); > kill (pid, SIGCONT); > wait (&x); > puts ("exiting parent"); > } > > Compiling the above program as "sigstopchld" and running it provides: > > m:\test>.\sigstopchld # Calling with SA_NOCLDSTOP > 0 = sigaction > exiting child > > ouch 20 # Just one SIGCHLD from child exit > exiting parent > > m:\test>.\sigstopchld 1 # SA_NOCLDSTOP not set > 0 = sigaction > ouch 20 # first SIGCHLD > exiting child > > ouch 20 # second SIGCHLD > exiting parent > > This indicates to me that SA_NOCLDSTOP is working as designed. > -- > Christopher Faylor spammer? -> aaaspam AT sourceware DOT org > Cygwin Project Leader > Red Hat, Inc. -- 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/