Re: lug-bg: fork, programirane
- Subject: Re: lug-bg: fork, programirane
- From: rsd@xxxxxxxxxxxxx (Dimo Dimitrov-DataManagement)
- Date: Thu, 4 May 2000 23:40:50 +1000
zdrawej,
"waitpid" triabwa da e w parent, a ne w child processa. Izpolzwai:
if (!fork())
{ /* this is the child process */
if (send (new_fd, "Hello, world! \n" , 14, 0) == -1 )
{
perror ("send");
close(new_fd);
exit(0);
}
}
else
{
close(new_fd); /* parent doesn't need this */
while (waitpid(-1, NULL, WNOHANG) > 0 ); // clean up child
process
}
chao : Dimo Dimitrov
<HR>
<UL>
<LI>application/x-pkcs7-signature \\\\\\\\\ \\\\: smime.p7s
</UL>
==================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers)
Otpiswaneto RABOTI !!! : Majordomo@xxxxxxxxxxxxxxxxxx UNSUBSCRIBE LUG-BG
http://www.linux-bulgaria.org/ Hosted by Internet Group Ltd. - Stara Zagora
|