Path: utzoo!attcan!uunet!van-bc!ubc-cs!alberta!ccu!news From: rahard@eeserv.ee.umanitoba.ca (Budi Rahardjo) Newsgroups: comp.lang.perl Subject: Does perl implement $SIG{'SIGCHLD'} ? Keywords: signal fork child zombie Message-ID: <1990Jul12.172141.14919@ccu.umanitoba.ca> Date: 12 Jul 90 17:21:41 GMT Sender: rahard@eeserv.ee.umanitoba.ca Followup-To: comp.lang.perl Organization: Dept. Electrical Engineering, U of Manitoba Lines: 36 Does perl implement $SIG{'SIGCHLD'} ? The following program will fork a child and let it dies, but it stays in "zombie" status. How do I exit from the child properly ? PS: run the program, and observe the status (ps -ux) before exiting. Thanks for the help -- Budi ----------------------------------------------------- #!/usr/local/bin/perl # Test forking a child and exit print "Testing fork\n"; print "I will fork a child and let the child dies\n"; $SIG{'SIGCHLD'} = 'dofireman'; # trap zombies $child=fork; if ($child == 0) { print "I am the children\n"; print "I'll exit now\n"; exit 0; } else { print "I am the parent\n"; print "Please observe if the child is in zombie status\n"; print "Hit return to quit "; getc; } sub dofireman { print "Catching ZOMBIE\n"; wait; } -- Budi Rahardjo Electrical Engineering - University of Manitoba - Canada