Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear sir;

I want to understand the fork system call Please can you help me?

Thanks in advance

Dalia
Posted
Comments
OriginalGriff 7-Jul-12 4:37am    
Don't repost a question to change the tags, or to add information - use the "Improve question" link instead.
I have deleted the older spare.

1 solution

Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...

A very quick search gave over three million results, the top of which was Wikipedia: http://en.wikipedia.org/wiki/Fork_(operating_system)[^] which gives a good general answer to a very general question.

In future, please try to do at least basic research yourself, and not waste your time or ours.
 
Share this answer
 
Comments
Member 8697827 8-Jul-12 2:30am    
I have read on google first but I cannot solve this problem
How may processes will be created when the following program is executed? Assume that all fork system calls are successful. what will be printed?
main()
{
int i=1;
int ret_val=0;
while(i{=5)
{
fork();
if(ret_val==0) /*child code*/
{printf("In child%d.\n",i);
exit(0);
}
else{/*parent code*/
i=i+1;
}}}
OriginalGriff 8-Jul-12 3:10am    
Why not correct the compilation errors, and run it, and see?
Then you can ask "Why did I get xxx?"
Member 8697827 8-Jul-12 3:42am    
ok could you put the link of the program because I don't have it
OriginalGriff 8-Jul-12 4:02am    
You don't have the code you posted an hour ago?
Copy it from your reply above?
Member 8697827 8-Jul-12 9:13am    
no the program not the code

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900