summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-06-20 17:38:27 -0400
committerOri Bernstein <ori@eigenstate.org>2014-06-20 17:38:27 -0400
commit3ecbc6e0019640b5075f7335233dd01f59ae693f (patch)
tree42813d751e124fa53c0a2b1c6dba1a7b7009dfab
parentc129c9edf109cadc5e78c271855b6594ad0f79a2 (diff)
downloadmc-3ecbc6e0019640b5075f7335233dd01f59ae693f.tar.gz
Fix struct stat.
We had the wrong types/sizes. especially for a 64 bit stat.
-rw-r--r--libstd/sys-linux.myr33
1 files changed, 17 insertions, 16 deletions
diff --git a/libstd/sys-linux.myr b/libstd/sys-linux.myr
index 74d00e5..4115347 100644
--- a/libstd/sys-linux.myr
+++ b/libstd/sys-linux.myr
@@ -44,20 +44,21 @@ pkg std =
;;
type statbuf = struct
- dev : uint64
- ino : uint64
- nlink : uint64
- mode : filemode
- uid : uint32
- gid : uint32
- __pad0 : uint32
- rdev : uint64
- size : uint64
- blksize : uint32
- blocks : uint64
- atime : timespec
- mtime : timespec
- ctime : timespec
+ dev : uint64
+ ino : uint64
+ nlink : uint64
+ mode : filemode
+ uid : uint32
+ gid : uint32
+ __pad0 : uint32
+ rdev : uint64
+ size : uint64
+ blksz : uint32
+ blocks : uint64
+ atime : timespec
+ mtime : timespec
+ ctime : timespec
+ __pad1 : uint64[3]
;;
type dirent64 = struct
@@ -493,8 +494,8 @@ pkg std =
const openmode : (path:byte[:], opts:fdopt, mode:int64 -> fd)
const close : (fd:fd -> int64)
const creat : (path:byte[:], mode:int64 -> fd)
- const read : (fd:fd, buf:byte[:] -> size)
- const write : (fd:fd, buf:byte[:] -> size)
+ const read : (fd:fd, buf:byte[:] -> int64)
+ const write : (fd:fd, buf:byte[:] -> int64)
const lseek : (fd:fd, off:uint64, whence:int64 -> int64)
const stat : (path:byte[:], sb:statbuf# -> int64)
const fstat : (fd:fd, sb:statbuf# -> int64)