{
struct tree *t = a->tree;
struct statfs sfs;
+#if defined(HAVE_STATVFS)
struct statvfs svfs;
+#endif
int r, vr = 0, xr = 0;
if (tree_current_is_symblic_link_target(t)) {
"openat failed");
return (ARCHIVE_FAILED);
}
+#if defined(HAVE_FSTATVFS)
vr = fstatvfs(fd, &svfs);/* for f_flag, mount flags */
+#endif
r = fstatfs(fd, &sfs);
if (r == 0)
xr = get_xfer_size(t, fd, NULL);
archive_set_error(&a->archive, errno, "fchdir failed");
return (ARCHIVE_FAILED);
}
+#if defined(HAVE_STATVFS)
vr = statvfs(tree_current_access_path(t), &svfs);
+#endif
r = statfs(tree_current_access_path(t), &sfs);
if (r == 0)
xr = get_xfer_size(t, -1, tree_current_access_path(t));
#endif
} else {
#ifdef HAVE_FSTATFS
+#if defined(HAVE_FSTATVFS)
vr = fstatvfs(tree_current_dir_fd(t), &svfs);
+#endif
r = fstatfs(tree_current_dir_fd(t), &sfs);
if (r == 0)
xr = get_xfer_size(t, tree_current_dir_fd(t), NULL);
archive_set_error(&a->archive, errno, "fchdir failed");
return (ARCHIVE_FAILED);
}
+#if defined(HAVE_STATVFS)
vr = statvfs(".", &svfs);
+#endif
r = statfs(".", &sfs);
if (r == 0)
xr = get_xfer_size(t, -1, ".");
return (ARCHIVE_FAILED);
} else if (xr == 1) {
/* pathconf(_PC_REX_*) operations are not supported. */
+#if defined(HAVE_STATVFS)
t->current_filesystem->xfer_align = svfs.f_frsize;
t->current_filesystem->max_xfer_size = -1;
t->current_filesystem->min_xfer_size = svfs.f_bsize;
t->current_filesystem->incr_xfer_size = svfs.f_bsize;
+#else
+ t->current_filesystem->xfer_align = sfs.f_frsize;
+ t->current_filesystem->max_xfer_size = -1;
+ t->current_filesystem->min_xfer_size = sfs.f_bsize;
+ t->current_filesystem->incr_xfer_size = sfs.f_bsize;
+#endif
}
switch (sfs.f_type) {
case AFS_SUPER_MAGIC:
}
#if defined(ST_NOATIME)
+#if defined(HAVE_STATVFS)
if (svfs.f_flag & ST_NOATIME)
+#else
+ if (sfs.f_flag & ST_NOATIME)
+#endif
t->current_filesystem->noatime = 1;
else
#endif