add unix.waitpid

This commit is contained in:
ValKmjolnir
2022-03-16 18:44:38 +08:00
parent c4d52a88cd
commit e6457651d3
5 changed files with 28 additions and 7 deletions
+1 -1
View File
@@ -277,7 +277,7 @@ var unix=
fork: func(){return __builtin_fork;},
dup2: func(fd0,fd1){die("not supported yet");},
exec: func(filename,argv,envp){die("not supported yet");},
waitpid: func(pid,nohang=0){die("not supported yet");},
waitpid: func(pid,nohang=0){return __builtin_waitpid;},
isdir: func(path){return bits.bitand(io.stat(path)[2],0x4000);}, # S_IFDIR 0x4000
isfile: func(path){return bits.bitand(io.stat(path)[2],0x8000);}, # S_IFREG 0x8000
opendir: func(path){return __builtin_opendir;},