summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-06-19 13:46:18 -0400
committerOri Bernstein <ori@eigenstate.org>2014-06-19 13:46:18 -0400
commit314b2c1651a2c946a3d9e3ccdd9fff739e603b2b (patch)
tree3013c84884ff640c077380ef7e9dd2bfb9542b6d
parenteee4c338620c5ed0bf64b7e90866a18598d75ec2 (diff)
downloadmc-314b2c1651a2c946a3d9e3ccdd9fff739e603b2b.tar.gz
Fix getdents() syscall.
-rw-r--r--libstd/sys-linux.myr8
1 files changed, 5 insertions, 3 deletions
diff --git a/libstd/sys-linux.myr b/libstd/sys-linux.myr
index 9d093bf..f03faf9 100644
--- a/libstd/sys-linux.myr
+++ b/libstd/sys-linux.myr
@@ -64,10 +64,11 @@ pkg std =
ino : uint64
;;
- type dirent = struct
+ type dirent64 = struct
ino : uint64
off : uint64
reclen : uint16
+ etype : byte
name : byte[0]
;;
@@ -107,6 +108,7 @@ pkg std =
const Onofollow : fdopt = 0x20000
const Ondelay : fdopt = 0x800
const Otrunc : fdopt = 0x200
+ const Odir : fdopt = 0x10000
/* mmap protection */
const Mprotnone : mprot = 0x0
@@ -492,7 +494,7 @@ pkg std =
const fstat : (fd:fd, sb:statbuf# -> int64)
const mkdir : (path : byte[:], mode : int64 -> int64)
const ioctl : (fd:fd, req : int64, args:... -> int64)
- const getdents64 : (fd:fd, dent : dirent#, count : uint64 -> int64)
+ const getdents64 : (fd:fd, buf : byte[:] -> int64)
/* networking */
const socket : (dom : sockfam, stype : socktype, proto : sockproto -> fd)
@@ -591,7 +593,7 @@ const ioctl = {fd, req, args
(arg, ap) = vanext(ap)
-> syscall(Sysioctl, fd, req, arg) castto(int64)
}
-const getdents64 = {fd, dent, count; -> syscall(Sysgetdents64, fd, dent, count)}
+const getdents64 = {fd, buf; -> syscall(Sysgetdents64, fd, buf castto(byte#), buf.len)}
/* networking */
const socket = {dom, stype, proto; -> syscall(Syssocket, dom castto(int64), stype, proto) castto(fd)}