RosettaCodeData/Task/Fork/Lua/fork.lua

11 lines
185 B
Lua
Raw Permalink Normal View History

2023-07-01 11:58:00 -04: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