Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Dec 1999 16:42:54 +0900
From:      =?ks_c_5601-1987?B?sei8ur/s?= <success@ecoin.co.kr>
To:        <freebsd-questions@FreeBSD.ORG>
Subject:   defunct problem
Message-ID:  <000c01bf4d19$538ffe10$31977ed2@george>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Hello.
I am programming on FreeBSD, and I meet a defunct problem.
I'm using C language and the function using on my program is just fork().
When the child is terminated normally, the child does not disappear and remains as defunct.
Of course, I set a signal as the following.

        signal( SIGIO,   SIG_DFL ); /* For select( ) */
        signal( SIGCHLD, SIG_IGN ); /* For prohibition of defunct */

and my signal handler is,

void sighandler(int sig)
{
    sighold(sig);
    LOG("signal %d received",sig);
    if (sig == SIGPIPE)
    {
      Terminate();
      kill(getpid(),SIGKILL);
    }
    if (sig == 18)
       signal(18,SIG_IGN);
    else
      Terminate();
      sigrelse(sig);
}

My program was normally run on Solaris 2.5, 2.6, Digital UNIX OSF1 V.4 and linux 6.0.
I just hope to know how to handle a defunct problem on FreeBSD.

I'll wait your quick reply.
Thank you.

Sincerely yours,

Kim, Sung Woo
success@ecoin.co.kr


[-- Attachment #2 --]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=ks_c_5601-1987" http-equiv=Content-Type>
<META content="MSHTML 5.00.2314.1000" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Hello.</FONT></DIV>
<DIV><FONT size=2>I am programming on FreeBSD, and I meet a defunct 
problem.</FONT></DIV>
<DIV><FONT size=2>I'm using C language and the function using on my program is 
just fork().</FONT></DIV>
<DIV><FONT size=2>When the child is terminated normally, the child does not 
disappear and remains as defunct.</FONT></DIV>
<DIV><FONT size=2>Of course, I set a signal as the following.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; signal( 
SIGIO,&nbsp;&nbsp; SIG_DFL ); /* For select( ) 
*/<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; signal( SIGCHLD, SIG_IGN ); /* 
For prohibition of defunct */<BR></FONT></DIV>
<DIV><FONT size=2>and my signal handler is,</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>void sighandler(int sig)<BR>{<BR>&nbsp;&nbsp;&nbsp; 
sighold(sig);<BR>&nbsp;&nbsp;&nbsp; LOG("signal %d 
received",sig);<BR>&nbsp;&nbsp;&nbsp; if (sig == SIGPIPE)<BR>&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Terminate();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
kill(getpid(),SIGKILL);<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; if (sig == 
18)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
signal(18,SIG_IGN);<BR>&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Terminate();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
sigrelse(sig);<BR>}<BR></FONT></DIV>
<DIV><FONT size=2>My program was&nbsp;normally run on Solaris 2.5, 2.6, Digital 
UNIX OSF1 V.4 and linux 6.0.</FONT></DIV>
<DIV><FONT size=2>I just hope to know how to handle a defunct problem on 
FreeBSD.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>I'll wait your quick reply.</FONT></DIV>
<DIV><FONT size=2>Thank you.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Sincerely yours,</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Kim, Sung Woo</FONT></DIV>
<DIV><FONT size=2><A 
href="mailto:email :&nbsp;&nbsp; success@ecoin.co.kr">success@ecoin.co.kr</A></FONT></DIV>
<DIV><FONT size=2>&nbsp;</DIV></FONT></BODY></HTML>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000c01bf4d19$538ffe10$31977ed2>