driver_freebsd.go 420 B

123456789101112131415161718192021
  1. package graphdriver
  2. import (
  3. "syscall"
  4. "golang.org/x/sys/unix"
  5. )
  6. var (
  7. // List of drivers that should be used in an order
  8. priority = "zfs"
  9. )
  10. // Mounted checks if the given path is mounted as the fs type
  11. func Mounted(fsType FsMagic, mountPath string) (bool, error) {
  12. var buf unix.Statfs_t
  13. if err := syscall.Statfs(mountPath, &buf); err != nil {
  14. return false, err
  15. }
  16. return FsMagic(buf.Type) == fsType, nil
  17. }