September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
14
Task/Fork/BaCon/fork.bacon
Normal file
14
Task/Fork/BaCon/fork.bacon
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
' Fork
|
||||
pid = FORK
|
||||
IF pid = 0 THEN
|
||||
PRINT "I am the child, my PID is:", MYPID
|
||||
ENDFORK
|
||||
ELIF pid > 0 THEN
|
||||
PRINT "I am the parent, pid of child:", pid
|
||||
REPEAT
|
||||
PRINT "Waiting for child to exit"
|
||||
SLEEP 50
|
||||
UNTIL REAP(pid)
|
||||
ELSE
|
||||
PRINT "Error in fork"
|
||||
ENDIF
|
||||
Loading…
Add table
Add a link
Reference in a new issue