Files
archer/internal/atomicfile/transient_windows.go
T
voidandClaude Sonnet 4.6 bc4a6b504f Initial commit: archer, a Go-native MySQL/MariaDB table archiver
Renamed from arcdb: module path, cmd/archer, internal/archererr,
docs, build scripts and ARCHER_* environment variables.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-11-06 22:12:17 +08:00

30 lines
678 B
Go

//go:build windows
package atomicfile
import (
"errors"
"syscall"
)
// Windows 上值得重试的错误码。
const (
errAccessDenied syscall.Errno = 5 // ERROR_ACCESS_DENIED
errSharingViol syscall.Errno = 32 // ERROR_SHARING_VIOLATION
errLockViolation syscall.Errno = 33 // ERROR_LOCK_VIOLATION
errBusy syscall.Errno = 170 // ERROR_BUSY
errUserMapped syscall.Errno = 1224 // ERROR_USER_MAPPED_FILE
)
func isTransientErrno(err error) bool {
var errno syscall.Errno
if !errors.As(err, &errno) {
return false
}
switch errno {
case errAccessDenied, errSharingViol, errLockViolation, errBusy, errUserMapped:
return true
}
return false
}