2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-18 08:34:20 +00:00
restic/internal/restic/node_aix.go

54 lines
1.4 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 restic
import (
"os"
"syscall"
)
2020-05-24 17:32:19 +00:00
func (node Node) restoreSymlinkTimestamps(_ 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) }
// Getxattr is a no-op on AIX.
func Getxattr(path, name string) ([]byte, error) {
return nil, nil
}
// Listxattr is a no-op on AIX.
func Listxattr(path string) ([]string, error) {
return nil, nil
}
func IsListxattrPermissionError(_ error) bool {
return false
}
2020-05-24 17:32:19 +00:00
// Setxattr is a no-op on AIX.
func Setxattr(path, name string, data []byte) error {
return nil
}
// restoreGenericAttributes is no-op on AIX.
func (node *Node) restoreGenericAttributes(_ string, warn func(msg string)) error {
return node.handleAllUnknownGenericAttributesFound(warn)
}
// fillGenericAttributes is a no-op on AIX.
func (node *Node) fillGenericAttributes(_ string, _ os.FileInfo, _ *statT) (allowExtended bool, err error) {
return true, nil
}