2022-03-28 16:23:47 -04:00
|
|
|
//go:build aix
|
2020-05-24 13:32:19 -04:00
|
|
|
// +build aix
|
|
|
|
|
|
2024-08-26 17:03:25 -04:00
|
|
|
package fs
|
2020-05-24 13:32:19 -04:00
|
|
|
|
2024-02-22 19:31:20 -05:00
|
|
|
import (
|
|
|
|
|
"os"
|
|
|
|
|
"syscall"
|
2024-08-26 17:03:25 -04:00
|
|
|
|
|
|
|
|
"github.com/restic/restic/internal/restic"
|
2024-02-22 19:31:20 -05:00
|
|
|
)
|
2020-05-24 13:32:19 -04:00
|
|
|
|
2024-08-26 16:35:22 -04:00
|
|
|
func nodeRestoreSymlinkTimestamps(_ string, _ [2]syscall.Timespec) error {
|
2020-05-24 13:32:19 -04: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) }
|
|
|
|
|
|
2024-08-26 16:35:22 -04:00
|
|
|
// nodeRestoreExtendedAttributes is a no-op on AIX.
|
2024-08-26 17:03:25 -04:00
|
|
|
func nodeRestoreExtendedAttributes(_ *restic.Node, _ string) error {
|
2024-05-17 16:18:20 -04:00
|
|
|
return nil
|
2020-05-24 13:32:19 -04:00
|
|
|
}
|
|
|
|
|
|
2024-08-26 16:35:22 -04:00
|
|
|
// nodeFillExtendedAttributes is a no-op on AIX.
|
2024-08-26 17:03:25 -04:00
|
|
|
func nodeFillExtendedAttributes(_ *restic.Node, _ string, _ bool) error {
|
2024-05-17 16:18:20 -04:00
|
|
|
return nil
|
2020-05-24 13:32:19 -04:00
|
|
|
}
|
|
|
|
|
|
2024-07-21 09:03:17 -04:00
|
|
|
// isListxattrPermissionError is a no-op on AIX.
|
|
|
|
|
func isListxattrPermissionError(_ error) bool {
|
2024-01-31 14:48:03 -05:00
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-26 16:35:22 -04:00
|
|
|
// nodeRestoreGenericAttributes is no-op on AIX.
|
2024-08-26 17:03:25 -04:00
|
|
|
func nodeRestoreGenericAttributes(node *restic.Node, _ string, warn func(msg string)) error {
|
|
|
|
|
return restic.HandleAllUnknownGenericAttributesFound(node.GenericAttributes, warn)
|
2024-02-22 19:31:20 -05:00
|
|
|
}
|
|
|
|
|
|
2024-08-26 16:35:22 -04:00
|
|
|
// nodeFillGenericAttributes is a no-op on AIX.
|
2024-08-26 17:03:25 -04:00
|
|
|
func nodeFillGenericAttributes(_ *restic.Node, _ string, _ os.FileInfo, _ *statT) (allowExtended bool, err error) {
|
2024-02-22 19:31:20 -05:00
|
|
|
return true, nil
|
|
|
|
|
}
|