summaryrefslogtreecommitdiff
path: root/tests/test-forkexecpwaitpid.lua
blob: b5362dfe871bd0a3ecdaaf6a6a79cb02d20731f1 (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.execp("sleep", "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