summaryrefslogtreecommitdiff
path: root/tests/test-forkexecwaitpid.lua
blob: ab10ec635b8d0b9b72df77008a245893b827098b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
local l = require "luxio"

local child = l.fork()

if child == 0 then
   l.exec("/bin/sleep", "/bin/sleep", "2")
else
   local pid, status = l.waitpid(child, l.WNOHANG)
   print("(WNOHANG)", pid, status)
   pid, status = l.waitpid(child, 0)
   print("WIFEXITED", l.WIFEXITED(status))
   print("WEXITSTATUS", l.WEXITSTATUS(status))
end