ref: 30e4700f5d0ce493c71289ce53bac2fb18c4664d
parent: db6f43d30083f873e340947829492303b4f9d057
author: Ori Bernstein <[email protected]>
date: Fri Jan 10 13:39:04 EST 2014
Add support for stat() calls on OSX
--- a/libstd/sys-osx.myr
+++ b/libstd/sys-osx.myr
@@ -38,10 +38,14 @@
uid : uint32
gid : uint32
rdev : int32
- atimesspec : timespec
- mtimesspec : timespec
- ctimesspec : timespec
- btimesspec : timespec
+ atime : timespec
+ atimens : timespec
+ mtime : timespec
+ mtimens : timespec
+ ctime : timespec
+ ctimens : timespec
+ btime : timespec
+ btimens : timespec
size : off
blocks : uint
blocksz : uint
@@ -504,6 +508,7 @@
const read : (fd:fd, buf:byte[:] -> size)
const write : (fd:fd, buf:byte[:] -> size)
const lseek : (fd:fd, off:uint64, whence:int64 -> int64)
+ const stat : (path:byte[:], sb:statbuf# -> int64)
const fstat : (fd:fd, sb:statbuf# -> int64)
const mkdir : (path : byte[:], mode : int64 -> int64)
@@ -591,6 +596,7 @@
const read = {fd, buf; -> syscall(Sysread, fd, buf castto(char#), buf.len castto(size)) castto(size)}
const write = {fd, buf; -> syscall(Syswrite, fd, buf castto(char#), buf.len castto(size)) castto(size)}
const lseek = {fd, off, whence; -> syscall(Syslseek, fd, off, whence)}
+const stat = {path, sb; -> syscall(Sysstat, cstring(path), sb)}
const fstat = {fd, sb; -> syscall(Sysfstat, fd, sb)}
const mkdir = {path, mode; -> syscall(Sysmkdir, cstring(path), mode) castto(int64)}