aboutsummaryrefslogtreecommitdiff
path: root/internal/syscallcompat/sys_linux.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-12-03 17:57:08 +0100
committerJakob Unterwurzacher2017-12-03 19:33:26 +0100
commit70bcf58a9bda5f95a3037fb785858f5d7ce3f930 (patch)
tree15122949d8adede1b6e8a68e7e2a2b19d42a1660 /internal/syscallcompat/sys_linux.go
parente33593d30d9dee6fd6b0e7c0d01832e478815d88 (diff)
syscallcompat: convert Getdents to fd input, add emulation
Now that we have Fstatat we can use it in Getdents to get rid of the path name. Also, add an emulated version of getdents for MacOS. This allows to drop the !HaveGetdents special cases from fusefrontend. Modify the getdents test to test both native getdents and the emulated version.
Diffstat (limited to 'internal/syscallcompat/sys_linux.go')
-rw-r--r--internal/syscallcompat/sys_linux.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/syscallcompat/sys_linux.go b/internal/syscallcompat/sys_linux.go
index fb8d8b3..b5b949e 100644
--- a/internal/syscallcompat/sys_linux.go
+++ b/internal/syscallcompat/sys_linux.go
@@ -7,6 +7,8 @@ import (
"golang.org/x/sys/unix"
+ "github.com/hanwen/go-fuse/fuse"
+
"github.com/rfjakob/gocryptfs/internal/tlog"
)
@@ -115,3 +117,8 @@ func Fstatat(dirfd int, path string, stat *unix.Stat_t, flags int) (err error) {
}
return unix.Fstatat(dirfd, path, stat, flags)
}
+
+// Getdents syscall.
+func Getdents(fd int) ([]fuse.DirEntry, error) {
+ return getdents(fd)
+}