summaryrefslogtreecommitdiff
path: root/lib/std/syswrap+posixy.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-05-08 18:14:07 +1200
committerOri Bernstein <ori@eigenstate.org>2016-05-08 18:14:07 +1200
commit0060152b535f0376265f0fe46bba45964fe1a8b0 (patch)
treeaf48b33b8a414712fcb34f9169ff9db6ff2e9023 /lib/std/syswrap+posixy.myr
parent4868e3b769c7b0d4c77c715df641219010be835b (diff)
downloadmc-0060152b535f0376265f0fe46bba45964fe1a8b0.tar.gz
We now can build and install on openbsd.
Diffstat (limited to 'lib/std/syswrap+posixy.myr')
-rw-r--r--lib/std/syswrap+posixy.myr5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/std/syswrap+posixy.myr b/lib/std/syswrap+posixy.myr
index 668ebc7..13ab684 100644
--- a/lib/std/syswrap+posixy.myr
+++ b/lib/std/syswrap+posixy.myr
@@ -105,7 +105,10 @@ const execv = {cmd, args; -> sys.execv(cmd, args) castto(errno)}
const execve = {cmd, args, env; -> sys.execve(cmd, args, env) castto(errno)}
/* memory stuff */
-const getmem = {sz; -> sys.mmap(0 castto(byte#), sz castto(sys.size), sys.Mprotrw, sys.Mpriv | sys.Manon, -1, 0)}
+const getmem = {sz;
+ sz = (sz + 4095) & ~4095
+ -> sys.mmap(0 castto(byte#), sz castto(sys.size), sys.Mprotrw, sys.Mpriv | sys.Manon, -1, 0)
+}
const freemem = {p, sz; sys.munmap(p, sz castto(sys.size))}
const curtime = {
var tm, sec, nsec