Bug 8908 - Problem with wait
Problem with wait
Status: CLOSED DUPLICATE of bug 4627
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
6.0
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Cristian Gafton
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-01-26 16:09 EST by tonyd
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-01-27 03:03:52 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
sigaction test case (1.26 KB, text/plain)
2000-01-27 14:25 EST, tonyd
no flags Details

  None (edit)
Description tonyd 2000-01-26 16:09:57 EST
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 03:03:59 EST
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 14:25:59 EST
Created attachment 80 [details]
sigaction test case
Comment 3 Cristian Gafton 2000-01-27 14:38:59 EST
the sigaction example pretty much works for me - what exactly are you after?

Note You need to log in before you can comment on or make changes to this bug.