2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-24 05:37:37 +00:00
restic/internal/fs/node_aix.go

52 lines
1.5 KiB
Go
Raw Normal View History

2022-03-28 20:23:47 +00:00
//go:build aix
2020-05-24 17:32:19 +00:00
// +build aix
package fs
2020-05-24 17:32:19 +00:00
import (
"os"
"syscall"
"github.com/restic/restic/internal/restic"
)
2020-05-24 17:32:19 +00:00
func nodeRestoreSymlinkTimestamps(_ string, _ [2]syscall.Timespec) error {
2020-05-24 17:32:19 +00:00
return nil
}
// AIX has a funny timespec type in syscall, with 32-bit nanoseconds.
// golang.org/x/sys/unix handles this cleanly, but we're stuck with syscall
// because os.Stat returns a syscall type in its os.FileInfo.Sys().
func toTimespec(t syscall.StTimespec_t) syscall.Timespec {
return syscall.Timespec{Sec: t.Sec, Nsec: int64(t.Nsec)}
}
func (s statT) atim() syscall.Timespec { return toTimespec(s.Atim) }
func (s statT) mtim() syscall.Timespec { return toTimespec(s.Mtim) }
func (s statT) ctim() syscall.Timespec { return toTimespec(s.Ctim) }
// nodeRestoreExtendedAttributes is a no-op on AIX.
func nodeRestoreExtendedAttributes(_ *restic.Node, _ string) error {
return nil
2020-05-24 17:32:19 +00:00
}
// nodeFillExtendedAttributes is a no-op on AIX.
func nodeFillExtendedAttributes(_ *restic.Node, _ string, _ bool) error {
return nil
2020-05-24 17:32:19 +00:00
}
// IsListxattrPermissionError is a no-op on AIX.
func IsListxattrPermissionError(_ error) bool {
return false
}
// nodeRestoreGenericAttributes is no-op on AIX.
func nodeRestoreGenericAttributes(node *restic.Node, _ string, warn func(msg string)) error {
return restic.HandleAllUnknownGenericAttributesFound(node.GenericAttributes, warn)
}
// nodeFillGenericAttributes is a no-op on AIX.
func nodeFillGenericAttributes(_ *restic.Node, _ string, _ os.FileInfo, _ *statT) (allowExtended bool, err error) {
return true, nil
}