ref: fc03d6189b22d17ac7554ac3de5ab5d47f7d0030
parent: e3ada3da7e9e7681e86b3f837071e21b499f857a
author: Ori Bernstein <[email protected]>
date: Mon Oct 6 14:34:12 EDT 2014
Fix osx libsys build.
--- a/libstd/dir+osx.myr
+++ b/libstd/dir+osx.myr
@@ -1,3 +1,5 @@
+use sys
+
use "alloc.use"
use "die.use"
use "option.use"
@@ -4,12 +6,11 @@
use "result.use"
use "slcp.use"
use "sldup.use"
-use "sys.use"
use "types.use"
pkg std =
type dir = struct
- fd : fd
+ fd : sys.fd
buf : byte[16384]
len : int64
off : int64
@@ -25,7 +26,7 @@
var fd
var dir
- fd = open(p, Ordonly | Odir)
+ fd = sys.open(p, sys.Ordonly | sys.Odir)
if fd < 0
-> `Fail "couldn't open directory"
;;
@@ -39,7 +40,7 @@
var dent
if d.off >= d.len
- len = getdirentries64(d.fd, d.buf[:], &d.base)
+ len = sys.getdirentries64(d.fd, d.buf[:], &d.base)
if len <= 0
-> `None
;;
@@ -47,13 +48,13 @@
d.off = 0
;;
- dent = &d.buf[d.off] castto(dirent64#)
+ dent = &d.buf[d.off] castto(sys.dirent64#)
d.off += dent.reclen castto(int64)
-> `Some sldup(dent.name[:dent.namlen])
}
const dirclose = {d
- close(d.fd)
+ sys.close(d.fd)
free(d)
}
--- a/libstd/syswrap.myr
+++ b/libstd/syswrap.myr
@@ -10,7 +10,6 @@
const Owronly : fdopt = sys.Owronly castto(fdopt)
const Ordwr : fdopt = sys.Ordwr castto(fdopt)
const Ocreat : fdopt = sys.Ocreat castto(fdopt)
- const Oexcl : fdopt = sys.Oexcl castto(fdopt)
const Otrunc : fdopt = sys.Otrunc castto(fdopt)
const Oappend : fdopt = sys.Oappend castto(fdopt)
const Odir : fdopt = sys.Odir castto(fdopt)