RosettaCodeData/Task/Fork/Lua/fork.lua

11 lines
185 B
Lua
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
local posix = require 'posix'
local pid = posix.fork()
if pid == 0 then
print("child process")
elseif pid > 0 then
print("parent process")
else
error("unable to fork")
end