aboutsummaryrefslogtreecommitdiff
path: root/internal/syscallcompat/sys_linux.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-06-18 15:40:38 +0200
committerJakob Unterwurzacher2017-06-18 15:43:22 +0200
commita4563e21ecaf7d2acce64212c96de69707d6f0bb (patch)
tree433f9917fdd734f7a06ae854f0713847aaa79f0c /internal/syscallcompat/sys_linux.go
parentafc3a8252bacbe15a0815e348aea7071447d7d87 (diff)
main, syscallcompat: use Dup3 instead of Dup2
Dup2 is not implemented on linux/arm64. Fixes https://github.com/rfjakob/gocryptfs/issues/121 . Also adds cross-compilation to CI.
Diffstat (limited to 'internal/syscallcompat/sys_linux.go')
-rw-r--r--internal/syscallcompat/sys_linux.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/syscallcompat/sys_linux.go b/internal/syscallcompat/sys_linux.go
index 93516f3..441f904 100644
--- a/internal/syscallcompat/sys_linux.go
+++ b/internal/syscallcompat/sys_linux.go
@@ -62,3 +62,9 @@ func Unlinkat(dirfd int, path string) error {
func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
return syscall.Mknodat(dirfd, path, mode, dev)
}
+
+// Dup3 wraps the Dup3 syscall. We want to use Dup3 rather than Dup2 because Dup2
+// is not implemented on arm64.
+func Dup3(oldfd int, newfd int, flags int) (err error) {
+ return syscall.Dup3(oldfd, newfd, flags)
+}