RosettaCodeData/Task/Fork/BaCon/fork.bacon
2023-07-01 13:44:08 -04:00

14 lines
285 B
Text

' 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