driver_freebsd.go 437 B

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