TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: BOB STOUT
from: DARIN MCBRIDE
date: 1998-02-13 20:05:00
subject: CALLING DOS COMMANDS

 > 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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.