diff options
author | Ori Bernstein <ori@eigenstate.org> | 2014-06-20 13:10:22 -0400 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2014-06-20 13:10:22 -0400 |
commit | 0dccb3c895c2f8f1f758b2702e5d5d967c8998c2 (patch) | |
tree | 511d838f5ceb940ef411f5b56379480bc74bd501 | |
parent | 34266f6c2a32738635087821af26dd1e4f58217d (diff) | |
download | mc-0dccb3c895c2f8f1f758b2702e5d5d967c8998c2.tar.gz |
Fix struct stat under Linux.
-rw-r--r-- | libstd/sys-linux.myr | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/libstd/sys-linux.myr b/libstd/sys-linux.myr index f03faf9..74d00e5 100644 --- a/libstd/sys-linux.myr +++ b/libstd/sys-linux.myr @@ -12,6 +12,7 @@ pkg std = type sockproto = int64 /* socket protocol */ type sockfam = uint16 /* socket family */ type whence = uint64 + type filemode = uint32 type clock = union `Clockrealtime @@ -44,24 +45,19 @@ pkg std = type statbuf = struct dev : uint64 - __inotrunc : uint32 - __pad0 : uint32 - mode : uint32 - nlink : uint32 + ino : uint64 + nlink : uint64 + mode : filemode uid : uint32 gid : uint32 + __pad0 : uint32 rdev : uint64 - __pad1 : uint32 size : uint64 blksize : uint32 blocks : uint64 - atime : uint64 - atimens : uint64 - mtime : uint64 - mtimens : uint64 - ctime : uint64 - ctimens : uint64 - ino : uint64 + atime : timespec + mtime : timespec + ctime : timespec ;; type dirent64 = struct @@ -110,6 +106,16 @@ pkg std = const Otrunc : fdopt = 0x200 const Odir : fdopt = 0x10000 + /* stat modes */ + const Sifmt : filemode = 0xf000 + const Sififo : filemode = 0x1000 + const Sifchr : filemode = 0x2000 + const Sifdir : filemode = 0x4000 + const Sifblk : filemode = 0x6000 + const Sifreg : filemode = 0x8000 + const Siflnk : filemode = 0xa000 + const Sifsock : filemode = 0xc000 + /* mmap protection */ const Mprotnone : mprot = 0x0 const Mprotrd : mprot = 0x1 |