Debian Codegraph @

chtimes_linux.go

raw symbols SCIP
1 //go:build linux
2 // +build linux
3
4 package fsutil
5
6 import (
7 "github.com/pkg/errors"
8 "golang.org/x/sys/unix"
9 )
10
11 func chtimes(path string, un int64) error {
12 var utimes [2]unix.Timespec
13 utimes[0] = unix.NsecToTimespec(un)
14 utimes[1] = utimes[0]
15
16 if err := unix.UtimesNanoAt(unix.AT_FDCWD, path, utimes[0:], unix.AT_SYMLINK_NOFOLLOW); err != nil {
17 return errors.Wrap(err, "failed call to UtimesNanoAt")
18 }
19
20 return nil
21 }