summaryrefslogtreecommitdiff
path: root/lib/std/syswrap-ss+freebsd.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-09-30 19:15:53 -0400
committerOri Bernstein <ori@eigenstate.org>2015-09-30 19:15:53 -0400
commite632cbfd8ca7424201e9054cc8c8d0a32a6c92c6 (patch)
treea97bbdff8ec0975d86dda99a6989a2e1c2b35fbe /lib/std/syswrap-ss+freebsd.myr
parent1fb34b1a5524bb3325a97e301a6cc51884a74bbb (diff)
downloadmc-e632cbfd8ca7424201e9054cc8c8d0a32a6c92c6.tar.gz
Fix FreeBSD port. Add missing files, and some ABI issues.
Diffstat (limited to 'lib/std/syswrap-ss+freebsd.myr')
-rw-r--r--lib/std/syswrap-ss+freebsd.myr24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/std/syswrap-ss+freebsd.myr b/lib/std/syswrap-ss+freebsd.myr
new file mode 100644
index 0000000..15bb6fa
--- /dev/null
+++ b/lib/std/syswrap-ss+freebsd.myr
@@ -0,0 +1,24 @@
+use sys
+use "errno.use"
+use "cstrconv.use"
+use "slcp.use"
+use "die.use"
+
+pkg std =
+ const exit : (status:int -> void)
+ pkglocal const bgetcwd : (buf : byte[:] -> errno)
+;;
+
+const exit = {status; sys.exit(status)}
+const bgetcwd = {buf
+ var res
+
+ res = sys.__getcwd(buf) castto(errno)
+ if res == 0
+ -> cstrlen(buf) castto(errno)
+ elif res == Enomem
+ -> Erange
+ else
+ -> res
+ ;;
+}