From de878a3346bcc070cf16fcacdc89269119489b45 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 25 Jan 2018 08:43:30 +0100 Subject: [PATCH] syscallcompat: explain why we don't use syscall.ParseDirent() syscall.ParseDirent only returns the NAMES, we want everything. --- internal/syscallcompat/getdents_linux.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/syscallcompat/getdents_linux.go b/internal/syscallcompat/getdents_linux.go index 49f9233..1b3569b 100644 --- a/internal/syscallcompat/getdents_linux.go +++ b/internal/syscallcompat/getdents_linux.go @@ -61,7 +61,10 @@ func getdents(fd int) ([]fuse.DirEntry, error) { offset += int(s.Reclen) numEntries++ } - // Parse the buffer into entries + // Parse the buffer into entries. + // Note: syscall.ParseDirent() only returns the names, + // we want all the data, so we have to implement + // it on our own. entries := make([]fuse.DirEntry, 0, numEntries) offset = 0 for offset < len(buf) {