Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions storage/pkg/system/utimes_freebsd.go

This file was deleted.

25 changes: 0 additions & 25 deletions storage/pkg/system/utimes_linux.go

This file was deleted.

22 changes: 22 additions & 0 deletions storage/pkg/system/utimes_unix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//go:build unix

package system

import (
"syscall"

"golang.org/x/sys/unix"
)

// LUtimesNano is used to change access and modification time of the specified path.
func LUtimesNano(path string, ts []syscall.Timespec) error {
ts_ := [2]unix.Timespec{
{Sec: ts[0].Sec, Nsec: ts[0].Nsec},
{Sec: ts[1].Sec, Nsec: ts[1].Nsec},
}
err := unix.UtimesNanoAt(unix.AT_FDCWD, path, ts_[:], unix.AT_SYMLINK_NOFOLLOW)
if err == unix.ENOSYS {
err = nil
}
return err
}
2 changes: 1 addition & 1 deletion storage/pkg/system/utimes_unix_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build linux || freebsd
//go:build unix

package system

Expand Down
4 changes: 2 additions & 2 deletions storage/pkg/system/utimes_unsupported.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//go:build !linux && !freebsd
//go:build !unix

package system

import "syscall"

// LUtimesNano is only supported on linux and freebsd.
// LUtimesNano is only supported on Unix systems.
func LUtimesNano(path string, ts []syscall.Timespec) error {
return ErrNotSupportedPlatform
}
Loading