+
+ let mut version = ptr::null();
+ check_call(unsafe { libmount::mnt_get_library_version(ptr::addr_of_mut!(version)) },
+ "Failed to get lib version");
+ println!("libmount version: {:?}", unsafe { CStr::from_ptr(version) });
+
+ let table = unsafe { libmount::mnt_new_table() };
+ check_call(unsafe {libmount::mnt_table_parse_mtab(table, ptr::null()) },
+ "Failed to parse mtab");
+ let mut fs = ptr::null_mut();
+ check_call(unsafe { libmount::mnt_table_first_fs(table, &mut fs) },
+ "Failed to find first fs");
+
+ println!("first fs type: {:?} source: {:?} target: {:?}",
+ unsafe { CStr::from_ptr (libmount::mnt_fs_get_fstype(fs)) },
+ unsafe { CStr::from_ptr (libmount::mnt_fs_get_source(fs)) },
+ unsafe { CStr::from_ptr (libmount::mnt_fs_get_target(fs)) });