summaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-08-24 06:07:30 -0700
committerOri Bernstein <ori@eigenstate.org>2018-08-24 06:07:30 -0700
commite54af86927ced66fb7fa8ad744cfb609390f04d8 (patch)
treebb297c1f908ef83ee6544a0bd1c7a424be0ae7c4 /lib/std
parent93cff6aba077499c3693896cba43b1ceaaca7a62 (diff)
downloadmc-e54af86927ced66fb7fa8ad744cfb609390f04d8.tar.gz
Add -v option, make it print test output.
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/syswrap+plan9.myr2
-rw-r--r--lib/std/syswrap+posixy.myr2
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/std/syswrap+plan9.myr b/lib/std/syswrap+plan9.myr
index fdfa704..92d8beb 100644
--- a/lib/std/syswrap+plan9.myr
+++ b/lib/std/syswrap+plan9.myr
@@ -46,6 +46,7 @@ pkg std =
const pwrite : (fd : fd, buf : byte[:], off : off -> result(size, errno))
const seek : (fd : fd, delta : off, whence : whence -> result(off, errno))
const pipe : (fds : fd[2]# -> errno)
+ const dup : (ofd : fd -> result(fd, errno))
const dup2 : (ofd : fd, nfd : fd -> result(fd, errno))
const nopipe : (-> void)
@@ -193,6 +194,7 @@ const write = {fd, buf; -> check(sys.pwrite((fd : sys.fd), buf, -1))}
const pwrite = {fd, buf,off; -> check(sys.pwrite((fd : sys.fd), buf, (off : sys.off)))}
const seek = {fd, off, whence; -> check(sys.seek((fd : sys.fd), (off : sys.off), (whence : int64)))}
const pipe = {fds; -> (sys.pipe((fds : sys.fd[2]#)) : errno)}
+const dup = {ofd; -> check((sys.dup(-1, (ofd : sys.fd)) : fd))}
const dup2 = {ofd, nfd; -> check(sys.dup((ofd : sys.fd), (nfd : sys.fd)))}
/* path manipulation */
diff --git a/lib/std/syswrap+posixy.myr b/lib/std/syswrap+posixy.myr
index 41c6e89..de62bef 100644
--- a/lib/std/syswrap+posixy.myr
+++ b/lib/std/syswrap+posixy.myr
@@ -45,6 +45,7 @@ pkg std =
const pwrite : (fd : fd, buf : byte[:], off : off -> result(size, errno))
const pipe : (fds : fd[2]# -> errno)
const seek : (fd : fd, delta : off, whence : whence -> result(off, errno))
+ const dup : (ofd : fd -> result(fd, errno))
const dup2 : (ofd : fd, nfd : fd -> result(fd, errno))
const nopipe : (-> void)
@@ -88,6 +89,7 @@ const write = {fd, buf; -> check(sys.write((fd : sys.fd), buf))}
const pwrite = {fd, buf,off; -> check(sys.pwrite((fd : sys.fd), buf, (off : sys.off)))}
const pipe = {fds; -> (sys.pipe((fds : sys.fd[2]#)) : errno)}
const seek = {fd, delta, whence; -> check(sys.lseek((fd : sys.fd), (delta : sys.off), (whence : sys.whence)))}
+const dup = {ofd; -> check((sys.dup((ofd : sys.fd)) : fd))}
const dup2 = {ofd, nfd; -> check((sys.dup2((ofd : sys.fd), (nfd : sys.fd)) : fd))}
const nopipe = {