Мне нужно получить f_type
от statfs
.Я попытался установить патч Filesys::Df
:
---
Df.pm | 6 +++---
Makefile.PL | 7 +------
XS_statfs | 1 +
3 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/Df.pm b/Df.pm
index b24bd9c..986082a 100644
--- a/Df.pm
+++ b/Df.pm
@@ -28,7 +28,7 @@ my %fs = ();
($block_size) ||
($block_size = 1024);
- my ($frsize, $blocks, $bfree, $bavail, $files, $ffree, $favail);
+ my ($frsize, $blocks, $bfree, $bavail, $files, $ffree, $favail, $ftype);
#### If open filehandle call fstatvfs or fstatfs
if(defined(fileno($dir))) {
@@ -36,7 +36,7 @@ my %fs = ();
}
else {
- ($frsize, $blocks, $bfree, $bavail, $files, $ffree, $favail) = _df($dir);
+ ($frsize, $blocks, $bfree, $bavail, $files, $ffree, $favail, $ftype) = _df($dir);
}
@@ -199,7 +199,7 @@ my %fs = ();
# $fs{user_files} = undef;
#}
-
+ $fs{type} = $ftype;
return(\%fs);
}
diff --git a/Makefile.PL b/Makefile.PL
index 6a89ec4..e91cbb3 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -21,12 +21,7 @@ if($Config{osname} =~ /^MSWin/i) {
die "You might try Filesys::DfPortable instead.\n";
}
-#### Check for the existance of statvfs
-if(check_statvfs()) {
- ####$define .= "-DDF_STATVFS ";
- copy_xs("XS_statvfs", $xs_file);
- print "Building with statvfs ....\n";
-}
+# force statfs
#### Check for the existance of statfs
elsif(check_statfs()) {
diff --git a/XS_statfs b/XS_statfs
index 856c646..ef801c3 100644
--- a/XS_statfs
+++ b/XS_statfs
@@ -45,6 +45,7 @@ _df(dir)
PUSHs(sv_2mortal(newSVnv((double)st.f_ffree)));
/* No favail */
PUSHs(sv_2mortal(newSVnv((double)st.f_ffree)));
+ PUSHs(sv_2mortal(newSVnv((double)st.f_type)));
}
else {
--
2.21.0
, а затем
perl Makefile.PL ; make ; perl -Mblib -MFilesys::Df=df -E'say df("/")->{type}'
, но это вылетает
panic: XSUB Filesys::Df::_df (Df.c) failed to extend arg stack: base=11d3b10, sp=11d3b50, hwm=11d3b48
Как мне решить эту проблему?