diff --git a/fs/loopback.go b/fs/loopback.go index 7aca0cb8f..5b6140da2 100644 --- a/fs/loopback.go +++ b/fs/loopback.go @@ -403,8 +403,8 @@ func (n *LoopbackNode) Setattr(ctx context.Context, f FileHandle, in *fuse.SetAt atime, aok := in.GetATime() if mok || aok { - ta := unix.Timespec{Nsec: unix.UTIME_OMIT} - tm := unix.Timespec{Nsec: unix.UTIME_OMIT} + ta := unix.Timespec{Nsec: unix_UTIME_OMIT} + tm := unix.Timespec{Nsec: unix_UTIME_OMIT} var err error if aok { ta, err = unix.TimeToTimespec(atime) diff --git a/fs/loopback_darwin.go b/fs/loopback_darwin.go index 0c9ce1d28..5f81f7c44 100644 --- a/fs/loopback_darwin.go +++ b/fs/loopback_darwin.go @@ -12,6 +12,8 @@ import ( "time" ) +const unix_UTIME_OMIT = 0x0 + // timeToTimeval - Convert time.Time to syscall.Timeval // // Note: This does not use syscall.NsecToTimespec because diff --git a/fs/loopback_freebsd.go b/fs/loopback_freebsd.go index a504ba638..13b97ac8b 100644 --- a/fs/loopback_freebsd.go +++ b/fs/loopback_freebsd.go @@ -7,6 +7,8 @@ import ( "golang.org/x/sys/unix" ) +const unix_UTIME_OMIT = unix.UTIME_OMIT + // FreeBSD has added copy_file_range(2) since FreeBSD 12. However, // golang.org/x/sys/unix hasn't add corresponding syscall constant or // wrap function. Here we define the syscall constant until sys/unix diff --git a/fs/loopback_linux.go b/fs/loopback_linux.go index 01d1193d7..08b99eb82 100644 --- a/fs/loopback_linux.go +++ b/fs/loopback_linux.go @@ -13,6 +13,8 @@ import ( "golang.org/x/sys/unix" ) +const unix_UTIME_OMIT = unix.UTIME_OMIT + func doCopyFileRange(fdIn int, offIn int64, fdOut int, offOut int64, len int, flags int) (uint32, syscall.Errno) { count, err := unix.CopyFileRange(fdIn, &offIn, fdOut, &offOut, len, flags)