summaryrefslogtreecommitdiff
path: root/lib/std/syswrap+plan9.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-05-05 21:41:38 -0700
committerOri Bernstein <ori@eigenstate.org>2016-05-05 21:41:38 -0700
commit36b4210be2a5d51607ba614d08e8369b19ca1e65 (patch)
tree60d6b2eb822d3a232678530dc9bc43bcbcb81e9e /lib/std/syswrap+plan9.myr
parentabadb828b42e44dd0e50be143745a0c15d8c6c83 (diff)
downloadmc-36b4210be2a5d51607ba614d08e8369b19ca1e65.tar.gz
Pull sleep into system specific code.
Diffstat (limited to 'lib/std/syswrap+plan9.myr')
-rw-r--r--lib/std/syswrap+plan9.myr8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/std/syswrap+plan9.myr b/lib/std/syswrap+plan9.myr
index 01ef4d9..c1291f4 100644
--- a/lib/std/syswrap+plan9.myr
+++ b/lib/std/syswrap+plan9.myr
@@ -66,6 +66,7 @@ pkg std =
const fork : (-> pid)
const execv : (cmd : byte[:], args : byte[:][:] -> errno)
const execve : (cmd : byte[:], args : byte[:][:], env : byte[:][:] -> errno)
+ const nanosleep : (nsecs : uint64 -> errno)
pkglocal const Canunmap : bool = true
pkglocal const getmem : (sz : size -> byte#)
@@ -198,11 +199,18 @@ const execv = {cmd, args;
sys.exec(cmd, args)
-> lasterr()
}
+
const execve = {cmd, args, env;
sys.exec(cmd, args)
-> lasterr()
}
+const nanosleep = {nsecs
+ if sys.sleep(nsecs/1_000_000) < 0
+ -> lasterr()
+ ;;
+}
+
/* memory stuff */
const getmem = {sz
var endp, oldp