Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006


Son how to kill the process?

I created a process, the outcome of the process elements still exist and how to handle them?

Son how to kill the process?

Your son created by the process of how the process? Fork ()?
Why did you have to kill?
Can code stickers?

Son how to kill the process?

Son how to kill the process?

I am doing is connecting socket, connecting client, through the process of dealing with sub-Call Client information.
I wanted to end it automatically after the completion of the implementation, there are still
Aaa.c
.....
If (!fork ())
     {
I++;
Bzero (buf, sizeof (buf));
Logmeg = fopen (. " /message.log "," A ");
Printf ( "NO:%.8d customers from %s \n", i, inet_ntoa (their_addr.sin_addr));
Fprintf (logmeg "No:%.8d customers from %s \n", i, inet_ntoa (their_addr.sin_
Addr));
If ((numbytes = recv (newfd, buf, sizeof (buf), 0)) ====== 1)
{
Perror ( "recv");
Close (newfd);
Exit (-1);
         }
Printf ( "Receiving information : %s num:%d\n", buf, numbytes);
Buf[numbytes]= '\0';
Fprintf (logmeg, "to receive information : %s \n", buf);
Exec_revstr (buf, newfd);
Exit (0);
     }
Help look?

Son how to kill the process?

Proposed landlord went wrong tree.

"Established a process", "However, there are still"

Do not understand.

Son how to kill the process?

I think after the implementation process son, should automatically end.
I call this process through sub-cycle process.
But through ps -ef
Alarm 19889 19880 0-- 00:00:00 "defunct>;
Alarm 19972 19880 0-- 00:00:00 "defunct>;
Alarm 19981 19880 0-- 00:00:00 "defunct>;

Son how to kill the process?

Father process to capture SIGCHLD signal transfer waitpid recycling resources.

Similar discussions before their check.

Son how to kill the process?

This is a zombie mummy you thread?


In addition,
[code]if ((Numbytes = recv (newfd, buf, sizeof (buf), 0)) ====== 1)
{
Perror ( "recv");
Close (newfd);
Exit (-1);
}
Printf ( "Receiving information : %s num:%d\n", buf, numbytes);
Buf[numbytes]= '\0' [/code]

Discovered bugs. If numbytes equivalent sizeof (buf), a cross-border buf[numbytes] on memory.

Son how to kill the process?

Of course, there are not a killing

Son how to kill the process?

See APUE, find signals chapter.



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com