Download this file
| 1 | //go:build !linux |
| 2 | |
| 3 | package host |
| 4 | |
| 5 | import ( |
| 6 | "errors" |
| 7 | "os" |
| 8 | "time" |
| 9 | ) |
| 10 | |
| 11 | // The floor files are written by root's apply and the agent, both of which |
| 12 | // run on a Linux box only (see systemapply_other.go). Off Linux every |
| 13 | // operation refuses, like openBeneath. |
| 14 | |
| 15 | type movesDir struct{} |
| 16 | |
| 17 | func openMovesDir(root string, create bool) (*movesDir, error) { return nil, errSystemUnsupported } |
| 18 | |
| 19 | func (d *movesDir) Close() {} |
| 20 | |
| 21 | func (d *movesDir) Lock() error { return errSystemUnsupported } |
| 22 | |
| 23 | func (d *movesDir) lockNamed(string, time.Duration, error) error { return errSystemUnsupported } |
| 24 | |
| 25 | func (d *movesDir) unlockRemoving() error { return errSystemUnsupported } |
| 26 | |
| 27 | func (d *movesDir) WriteDurable(name string, data []byte, mode os.FileMode) error { |
| 28 | return errSystemUnsupported |
| 29 | } |
| 30 | |
| 31 | // floorLockCannotExist: off Linux the lock never exists (openMovesDir |
| 32 | // refuses), and neither can a floor. |
| 33 | func floorLockCannotExist(err error) bool { return errors.Is(err, errSystemUnsupported) } |
| 34 | |