SIGCHLD, SIG_IGN and zombie processes
From: Grzegorz Jablonski (gwj_at_mangled_w-s.pl)
Date: 09/27/03
- Next message: Kasper Dupont: "Re: SIGCHLD, SIG_IGN and zombie processes"
- Previous message: Michal Wojciechowski: "Re: ARP packet and Hardware Address Type"
- Next in thread: Kasper Dupont: "Re: SIGCHLD, SIG_IGN and zombie processes"
- Reply: Kasper Dupont: "Re: SIGCHLD, SIG_IGN and zombie processes"
- Reply: David W Noon: "Re: SIGCHLD, SIG_IGN and zombie processes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 27 Sep 2003 22:51:49 +0200
Hello all,
I have the following program:
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
int main ()
{
int i, j;
signal (SIGCHLD, SIG_IGN);
printf ("server waiting\n");
if (fork () == 0)
{
printf ("hello from child\n");
sleep (1);
printf ("goodbye from child\n");
exit (0);
}
for (i = 0; i < 10000000; i++) j += i;
sleep (300);
exit (0);
}
I ignore SIGCHLD to prevent creation of the zombie processes.
This program works as intended, no zombie is created.
If I remove the dummy for loop, the zombie process appears.
Am I mising something, or is it a bug?
I use kernel 2.4.21 with glibc-2.3.1
Regards,
GWJ
- Next message: Kasper Dupont: "Re: SIGCHLD, SIG_IGN and zombie processes"
- Previous message: Michal Wojciechowski: "Re: ARP packet and Hardware Address Type"
- Next in thread: Kasper Dupont: "Re: SIGCHLD, SIG_IGN and zombie processes"
- Reply: Kasper Dupont: "Re: SIGCHLD, SIG_IGN and zombie processes"
- Reply: David W Noon: "Re: SIGCHLD, SIG_IGN and zombie processes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|