RosettaCodeData/Task/Fork/Wren/fork-1.wren
2023-12-16 21:33:55 -08:00

20 lines
372 B
Text

/* Fork.wren */
class C {
foreign static fork()
foreign static usleep(usec)
foreign static wait()
}
var pid = C.fork()
if (pid == 0) {
C.usleep(10000)
System.print("\tchild process: done")
} else if (pid < 0) {
System.print("fork error")
} else {
System.print("waiting for child %(pid)...")
System.print("child %(C.wait()) finished")
}