LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-29-2002, 04:59 PM   #1
barbanero
Member
 
Registered: Jan 2002
Location: Bucharest
Distribution: RedHat, AIX
Posts: 39

Rep: Reputation: 15
answer waiting for son


Here is a few line of codes.

I hope is usefull for you!

int main()
{
pid_t pid,w;
int status;
for(i=0;i<3;i++)
{
if((pid=fork())==0)

{

bla,bla,bla

}
else
printf("Fork son %d\n",pid);
}

/*Waiting for son*/

while((w=wait(&status)) && w !=-1)
{
if(w != -1)
printf("The waiting for PID: %d has return status : %040X\n", w, status);
}
exit(0);
}

-------------------

Any improvements are welcome!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hard Drive Problems: timeout waiting for DMA; error waiting for DMA mintee Linux - Hardware 10 09-21-2007 05:06 AM
My son is innocent! Seiken Slackware 38 11-17-2005 03:11 PM
Son and I are now Slackers - wife next? mikieboy LinuxQuestions.org Member Success Stories 3 11-16-2005 06:05 PM
fork and multiple son processes biiiep Programming 4 05-11-2005 11:00 AM
How to tell if your son is a hacker - Complete Bull$hit!!! 2kool General 22 05-06-2002 04:45 AM


All times are GMT -5. The time now is 03:23 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration