def GetFileSystems():
 version = OSXVersion()
 (major, minor) = version.VersionAsMajorMinor()
 libc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('c'))
 if ((major <= 10) and (minor <= 5)):
  use_64 = False
  fs_struct = StatFSStruct
 else:
  use_64 = True
  fs_struct = StatFS64Struct
 struct_size = fs_struct.GetSize()
 buf_size = (struct_size * 20)
 cbuf = ctypes.create_string_buffer(buf_size)
 if use_64:
  ret = libc.getfsstat64(ctypes.byref(cbuf), buf_size, 2)
 else:
  ret = libc.getfsstat(ctypes.byref(cbuf), buf_size, 2)
 if (ret == 0):
  logging.debug('getfsstat failed err: %s', ret)
  return []
 return ParseFileSystemsStruct(fs_struct, ret, cbuf)

def GetFileSystems ( ) : version = OSXVersion ( ) ( major , minor ) = version . VersionAsMajorMinor ( ) libc = ctypes . cdll . LoadLibrary ( ctypes . util . find_library ( 'c' ) ) if ( ( major <= 10 ) and ( minor <= 5 ) ) : use_64 = False fs_struct = StatFSStruct else : use_64 = True fs_struct = StatFS64Struct struct_size = fs_struct . GetSize ( ) buf_size = ( struct_size * 20 ) cbuf = ctypes . create_string_buffer ( buf_size ) if use_64 : ret = libc . getfsstat64 ( ctypes . byref ( cbuf ) , buf_size , 2 ) else : ret = libc . getfsstat ( ctypes . byref ( cbuf ) , buf_size , 2 ) if ( ret == 0 ) : logging . debug ( 'getfsstat failed err: %s' , ret ) return [ ] return ParseFileSystemsStruct ( fs_struct , ret , cbuf )
make syscalls to get the mounted filesystems .