@@ -420,37 +420,6 @@ fn mount_dev_id(mount_dir: &OsStr) -> String {
420420 }
421421}
422422
423- #[ cfg( any(
424- target_os = "freebsd" ,
425- target_vendor = "apple" ,
426- target_os = "netbsd" ,
427- target_os = "openbsd"
428- ) ) ]
429- use libc:: c_int;
430- #[ cfg( any(
431- target_os = "freebsd" ,
432- target_vendor = "apple" ,
433- target_os = "netbsd" ,
434- target_os = "openbsd"
435- ) ) ]
436- unsafe extern "C" {
437- #[ cfg( all( target_vendor = "apple" , target_arch = "x86_64" ) ) ]
438- #[ link_name = "getmntinfo$INODE64" ]
439- fn get_mount_info ( mount_buffer_p : * mut * mut StatFs , flags : c_int ) -> c_int ;
440-
441- #[ cfg( any(
442- target_os = "netbsd" ,
443- target_os = "openbsd" ,
444- all( target_vendor = "apple" , target_arch = "aarch64" )
445- ) ) ]
446- #[ link_name = "getmntinfo" ]
447- fn get_mount_info ( mount_buffer_p : * mut * mut StatFs , flags : c_int ) -> c_int ;
448-
449- #[ cfg( target_os = "freebsd" ) ]
450- #[ link_name = "getmntinfo" ]
451- fn get_mount_info ( mount_buffer_p : * mut * mut StatFs , flags : c_int ) -> c_int ;
452- }
453-
454423use crate :: error:: UResult ;
455424#[ cfg( any(
456425 target_os = "freebsd" ,
@@ -505,9 +474,9 @@ pub fn read_fs_list() -> UResult<Vec<MountInfo>> {
505474 ) ) ]
506475 {
507476 let mut mount_buffer_ptr: * mut StatFs = ptr:: null_mut ( ) ;
508- let len = unsafe { get_mount_info ( & raw mut mount_buffer_ptr, 1_i32 ) } ;
477+ let len = unsafe { libc :: getmntinfo ( & raw mut mount_buffer_ptr, 1_i32 ) } ;
509478 if len < 0 {
510- return Err ( USimpleError :: new ( 1 , "get_mount_info () failed" ) ) ;
479+ return Err ( USimpleError :: new ( 1 , "getmntinfo () failed" ) ) ;
511480 }
512481 let mounts = unsafe { slice:: from_raw_parts ( mount_buffer_ptr, len as usize ) } ;
513482 Ok ( mounts
0 commit comments