That's why you read the manpage on a function before you apply it rather than just cutting-and-pasting the first bit of code google returns when you search for 'fork example unix'.
(In this particular case that actually returns (for me) a bit of code that gets it right.)
(In this particular case that actually returns (for me) a bit of code that gets it right.)