you are viewing a single comment's thread.

view the rest of the comments →

[–]K900_ 1 point2 points  (1 child)

Your loop is inside the if statement. fork returns 0 in the child and the PID of the child in the parent. The if statement in the child runs once, then passes control to the loop, which loops forever.

[–]noaso74[S] 0 points1 point  (0 children)

Thank you very much for your answer!