| 1 | package fstestutil |
| 2 | |
| 3 | // MountInfo describes a mounted file system. |
| 4 | type MountInfo struct { |
| 5 | FSName string |
| 6 | Type string |
| 7 | } |
| 8 | |
| 9 | // GetMountInfo finds information about the mount at mnt. It is |
| 10 | // intended for use by tests only, and only fetches information |
| 11 | // relevant to the current tests. |
| 12 | func GetMountInfo(mnt string) (*MountInfo, error) { |
| 13 | return getMountInfo(mnt) |
| 14 | } |
| 15 | |
| 16 | // cstr converts a nil-terminated C string into a Go string |
| 17 | func cstr(ca []int8) string { |
| 18 | s := make([]byte, 0, len(ca)) |
| 19 | for _, c := range ca { |
| 20 | if c == 0x00 { |
| 21 | break |
| 22 | } |
| 23 | s = append(s, byte(c)) |
| 24 | } |
| 25 | return string(s) |
| 26 | } |