diff options
author | Jakob Unterwurzacher | 2018-06-08 00:47:48 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2018-06-08 00:47:48 +0200 |
commit | bde7ba57b06eb46f8901454e12524a74a8c3b6e8 (patch) | |
tree | 96b1a729897fcb6df14052a199a91543cc2f8a87 /internal | |
parent | 5ad26495fc86527bbfe75ac6b46528d49a373676 (diff) |
darwin does not have PATH_MAX
Define our own, with the value from Linux.
Diffstat (limited to 'internal')
-rw-r--r-- | internal/fusefrontend_reverse/rfs.go | 3 | ||||
-rw-r--r-- | internal/syscallcompat/sys_common.go | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/internal/fusefrontend_reverse/rfs.go b/internal/fusefrontend_reverse/rfs.go index b281c76..829983b 100644 --- a/internal/fusefrontend_reverse/rfs.go +++ b/internal/fusefrontend_reverse/rfs.go @@ -333,8 +333,7 @@ func (rfs *ReverseFS) Readlink(relPath string, context *fuse.Context) (string, f cTarget := rfs.nameTransform.B64.EncodeToString(cBinTarget) // The kernel will reject a symlink target above 4096 chars and return // and I/O error to the user. Better emit the proper error ourselves. - const PATH_MAX = 4096 // not defined on Darwin - if len(cTarget) > PATH_MAX { + if len(cTarget) > syscallcompat.PATH_MAX { return "", fuse.Status(syscall.ENAMETOOLONG) } return cTarget, fuse.OK diff --git a/internal/syscallcompat/sys_common.go b/internal/syscallcompat/sys_common.go index 21823ef..77cdb07 100644 --- a/internal/syscallcompat/sys_common.go +++ b/internal/syscallcompat/sys_common.go @@ -6,6 +6,8 @@ import ( "golang.org/x/sys/unix" ) +const PATH_MAX = 4096 // not defined on Darwin + // Readlinkat exists both in Linux and in MacOS 10.10+. We may add an // emulated version for users on older MacOS versions if there is // demand. |