7 #include <sys/mnttab.h>
15 func parseMountTable() ([]*Info, error) {
16 mnttab := C.fopen(C.CString(C.MNTTAB), C.CString("r"))
18 return nil, fmt.Errorf("Failed to open %s", C.MNTTAB)
22 var mp C.struct_mnttab
24 ret := C.getmntent(mnttab, &mp)
27 mountinfo.Mountpoint = C.GoString(mp.mnt_mountp)
28 mountinfo.Source = C.GoString(mp.mnt_special)
29 mountinfo.Fstype = C.GoString(mp.mnt_fstype)
30 mountinfo.Opts = C.GoString(mp.mnt_mntopts)
31 out = append(out, &mountinfo)
32 ret = C.getmntent(mnttab, &mp)