Bug 8908

Summary: Problem with wait
Product: [Retired] Red Hat Linux Reporter: tonyd
Component: glibcAssignee: Cristian Gafton <gafton>
Status: CLOSED DUPLICATE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 6.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-01-27 08:03:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
sigaction test case none

Description tonyd 2000-01-26 21:09:57 UTC
This is is in relation to BUG# 4627
The wait call doesn't wake up when a signal is received.

We tried to use sigaction but the same thing happens.
here is the code we use to test this.


#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/errno.h>

void static fsigint(s)
int s;
{

   printf("signal %d received\n", s);

}


int main(argc, argv)
int argc;
char *argv[];
{
   int pid;
   int status;

   printf("Current process id is %d\n", getpid());

   pid = fork();   if (pid == 0) {

      printf("Forked process id is %d\n", getpid());
      sleep(1000);
      exit(0);
   }

   signal(SIGINT, fsigint);

   while(1)
   {
      errno = 0;
      status = 0;

      printf("ready and waiting...\n");
      pid = wait(&status);

      printf("after wait pid = %d errno = %d\n", pid, errno);

   }
   exit(0);
}

Comment 1 Cristian Gafton 2000-01-27 08:03:59 UTC
The test case will not work. Try to use sigaction (or forward the test case you
used with sigaction)

signal() is unreliable. See bug #4627 for more details.


*** This bug has been marked as a duplicate of 4627 ***

Comment 2 tonyd 2000-01-27 19:25:59 UTC
Created attachment 80 [details]
sigaction test case

Comment 3 Cristian Gafton 2000-01-27 19:38:59 UTC
the sigaction example pretty much works for me - what exactly are you after?