//go:build !linux package host import ( "errors" "os" "time" ) // The floor files are written by root's apply and the agent, both of which // run on a Linux box only (see systemapply_other.go). Off Linux every // operation refuses, like openBeneath. type movesDir struct{} func openMovesDir(root string, create bool) (*movesDir, error) { return nil, errSystemUnsupported } func (d *movesDir) Close() {} func (d *movesDir) Lock() error { return errSystemUnsupported } func (d *movesDir) lockNamed(string, time.Duration, error) error { return errSystemUnsupported } func (d *movesDir) unlockRemoving() error { return errSystemUnsupported } func (d *movesDir) WriteDurable(name string, data []byte, mode os.FileMode) error { return errSystemUnsupported } // floorLockCannotExist: off Linux the lock never exists (openMovesDir // refuses), and neither can a floor. func floorLockCannotExist(err error) bool { return errors.Is(err, errSystemUnsupported) }