+
+#if HAVE_STRUCT_STATFS_F_FLAGS
+ if (Mono_Posix_ToMountFlags (from->f_flags, &to->f_flag) != 0)
+ return -1;
+#endif /* def HAVE_STRUCT_STATFS_F_FLAGS */
+
+ return 0;
+}
+
+int
+Mono_Posix_FromStatvfs (struct Mono_Posix_Statvfs *from, void *_to)
+{
+ struct statfs *to = _to;
+ guint64 flag;
+
+ to->f_bsize = from->f_bsize;
+ to->f_blocks = from->f_blocks;
+ to->f_bfree = from->f_bfree;
+ to->f_bavail = from->f_bavail;
+ to->f_files = from->f_files;
+ to->f_ffree = from->f_ffree;
+
+ // from->f_fsid is an int32[2], to->f_fsid is a uint64,
+ // so this shouldn't lose anything.
+ memcpy (&to->f_fsid, &from->f_fsid, sizeof(to->f_fsid));
+
+#if HAVE_STRUCT_STATFS_F_FLAGS
+ if (Mono_Posix_FromMountFlags (from->f_flag, &flag) != 0)
+ return -1;
+ to->f_flags = flag;
+#endif /* def HAVE_STRUCT_STATFS_F_FLAGS */
+
+ return 0;