carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1//go:build !linux
2
3package host
4
5import (
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
15type movesDir struct{}
16
17func openMovesDir(root string, create bool) (*movesDir, error) { return nil, errSystemUnsupported }
18
19func (d *movesDir) Close() {}
20
21func (d *movesDir) Lock() error { return errSystemUnsupported }
22
23func (d *movesDir) lockNamed(string, time.Duration, error) error { return errSystemUnsupported }
24
25func (d *movesDir) unlockRemoving() error { return errSystemUnsupported }
26
27func (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.
33func floorLockCannotExist(err error) bool { return errors.Is(err, errSystemUnsupported) }
34