ref: 6f7129fd1e2b094e42cbfa2752222a7e61b5c298
parent: b174339235cbd737635b949e2b93b1f5b2c2dbdf
author: Ori Bernstein <[email protected]>
date: Wed Jun 18 22:19:03 EDT 2014
Add getdents function to linux.
--- a/libstd/sys-linux.myr
+++ b/libstd/sys-linux.myr
@@ -64,6 +64,13 @@
ino : uint64
;;
+ type dirent = struct
+ ino : uint64
+ off : uint64
+ reclen : uint16
+ name : byte[0]
+ ;;
+
type utsname = struct
system : byte[65]
node : byte[65]
@@ -485,6 +492,7 @@
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)
/* networking */
const socket : (dom : sockfam, stype : socktype, proto : sockproto -> fd)
@@ -583,6 +591,7 @@
(arg, ap) = vanext(ap)
-> syscall(Sysioctl, fd, req, arg) castto(int64)
}
+const getdents64 = {fd, dent, count; -> syscall(Sysgetdents64, fd, dent, count)}
/* networking */
const socket = {dom, stype, proto; -> syscall(Syssocket, dom castto(int64), stype, proto) castto(fd)}