syscallcompat: explain why we don't use syscall.ParseDirent()

syscall.ParseDirent only returns the NAMES, we want
everything.
libgocryptfs
Jakob Unterwurzacher 5 years ago
parent 7015a6ebfb
commit de878a3346
  1. 5
      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) {

Loading…
Cancel
Save