> What exactly IS fork()
BS> The fork() function does pretty much what it says -
Er, Bob, take a step back - what does "fork()" say? To me, it's a utensil I
eat salad with. I'm just looking for a spoon() to eat soup with!
To some of us who understand that it is indeed referring to a fork in a road
where a road splits into two roads, fork() actually verbs this noun. Again,
not exactly "what it says." It _creates_ what it says - a fork in the
processes.
Thankfully, the rest of your message explains much better than your opening
sentence. :-)
I would recommend one minor addition: you were speaking of the "general" way
of creating another process. Shown as:
switch(fork())
{
case -1:
/* error handling */
break;
case 0:
/* exec call: */
exit(exec(...));
default:
break;
}
Noting, however, that true unix hacking gurus would not deign to use such
(relatively) readable code... ;-)
---
---------------
* Origin: Tanktalus' Tower BBS (1:250/102)
|