ref: 841bbb2787781233f55833edada40e72bcf5530f
parent: a986cbd00e4377d04ae1a4018d278689e209fbbc
author: Ori Bernstein <[email protected]>
date: Fri Jun 20 13:38:27 EDT 2014
Fix struct stat. We had the wrong types/sizes. especially for a 64 bit stat.
--- a/libstd/sys-linux.myr
+++ b/libstd/sys-linux.myr
@@ -44,20 +44,21 @@
;;
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 @@
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)