ref: 6667651f72614dc2488e352d21403697b33504aa
parent: f8ef5456ae98b919838cd324a5a5510efaed0290
author: Ori Bernstein <[email protected]>
date: Tue Dec 23 10:01:13 EST 2014
wait() gets to be a syscall.
--- a/libstd/die.myr
+++ b/libstd/die.myr
@@ -8,7 +8,7 @@
const die = {msg
write(2, msg)
- kill(getpid(), 6)
+ suicide()
}
const assert = {cond, msg
--- a/libstd/syswrap.myr
+++ b/libstd/syswrap.myr
@@ -29,7 +29,7 @@
/* process stuff */
const getpid : ( -> pid)
- const kill : (pid:pid, sig:int64 -> int64)
+ const suicide : ( -> int64)
const fork : (-> pid)
const execv : (cmd : byte[:], args : byte[:][:] -> int64)
const execve : (cmd : byte[:], args : byte[:][:], env : byte[:][:] -> int64)
@@ -52,7 +52,7 @@
/* process stuff */
const getpid = {; -> sys.getpid() castto(pid)}
-const kill = {pid, sig; -> sys.kill(pid castto(sys.pid), sig)}
+const suicide = {; -> sys.kill(sys.getpid(), 6)} /* kill self with sigabort */
const fork = {; -> sys.fork() castto(pid)}
const execv = {cmd, args; -> sys.execv(cmd, args)}
const execve = {cmd, args, env; -> sys.execve(cmd, args, env)}