libgocryptfs/internal/syscallcompat
Sebastian Lackner 682e642cfa fusefrontend: Rework the Utimens handling on macOS.
For Linux, everything effectively stays the same. For both path-based and
fd-based Utimens() calls, we use unix.UtimesNanoAt(). To avoid introducing
a separate syscall wrapper for futimens() (as done in go-fuse, for example),
we instead use the /proc/self/fd - trick.

On macOS, this changes quite a lot:

* Path-based Utimens() calls were previously completely broken, since
  unix.UtimensNanoAt() ignores the passed file descriptor. Note that this
  cannot be fixed easily since there IS no appropriate syscall available on
  macOS prior to High Sierra (10.13). We emulate this case by using
  Fchdir() + setattrlist().

* Fd-based Utimens() calls were previously translated to f.GetAttr() (to
  fill any empty parameters) and syscall.Futimes(), which does not does
  support nanosecond precision. Both issues can be fixed by switching to
  fsetattrlist().

Fixes https://github.com/rfjakob/gocryptfs/issues/350
2019-01-16 20:55:20 +01:00
..
emulate_test.go syscallcompat: Drop Fstatat emulation on macOS. 2019-01-14 21:27:28 +01:00
emulate.go syscallcompat: Drop Fstatat emulation on macOS. 2019-01-14 21:27:28 +01:00
getdents_linux.go syscallcompat: downgrade DT_UNKNOWN message level on XFS 2018-11-17 17:44:21 +01:00
getdents_other.go syscallcompat: convert Getdents to fd input, add emulation 2017-12-03 19:33:26 +01:00
getdents_test.go gccgo: skip emulateGetdents on linux 2018-02-04 21:14:12 +01:00
helpers.go fusefrontend: doWrite: delete file header if first write fails 2018-07-15 15:12:55 +02:00
main_test.go syscallcompat: move test setup into its own file 2017-12-02 19:57:23 +01:00
open_nofollow_test.go syscallcompat: untangle OpenNofollow and rename to OpenDirNofollow 2018-09-08 17:41:17 +02:00
open_nofollow.go syscallcompat: Use O_PATH to open base directory. 2019-01-03 18:24:05 +01:00
sys_common_test.go tests: reduce noise on MacOS 2019-01-14 22:11:15 +01:00
sys_common.go syscallcompat: Drop Fstatat emulation on macOS. 2019-01-14 21:27:28 +01:00
sys_darwin.go fusefrontend: Rework the Utimens handling on macOS. 2019-01-16 20:55:20 +01:00
sys_linux.go fusefrontend: Rework the Utimens handling on macOS. 2019-01-16 20:55:20 +01:00
unix2syscall_darwin.go syscallcompat: add Darwin version of unix2syscall 2017-12-06 00:18:38 +01:00
unix2syscall_linux.go Fix assignment error in Unix2syscall by converting Timespec into Nsec (#203) 2018-02-03 13:42:49 +01:00