From: Dobrica Pavlinusic Date: Sun, 20 Mar 2005 00:37:31 +0000 (+0000) Subject: Richard Dawe X-Git-Tag: 0.05~1 X-Git-Url: http://git.rot13.org/?p=perl-fuse.git;a=commitdiff_plain;h=f22646ee1a622b508e671121213c5209b39b3b1d Richard Dawe Please find attached a patch that makes statfs.t pass on the x86_64 architecture. With Linux on x86_64 statfs returns 64-bit fields by default, so the unpack format returns junk. I also found that I would get a glibc warning about memory corruption. This is because the statfs structure returned by the kernel includes some padding for future expansion. So the statfs buffer also needed to be made bigger. git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl/trunk@11 6e4b0b00-1209-0410-87b2-b275959b5705 --- diff --git a/test/statfs.t b/test/statfs.t index fb94704..31e140f 100644 --- a/test/statfs.t +++ b/test/statfs.t @@ -3,14 +3,14 @@ use test::helper qw($_real $_point); use Test::More; require 'syscall.ph'; # for SYS_statfs plan tests => 7; -my ($statfs_data) = " " x 10; +my ($statfs_data) = " " x 16; my ($tmp) = $_point; ok(!syscall(&SYS_statfs,$tmp,$statfs_data),"statfs"); # FIXME: this is soooooo linux-centric. perhaps parse the output of /bin/df? -my @list = unpack("LSSL8",$statfs_data); +my @list = unpack("L!7L2L!7",$statfs_data); +print join(', ', @list)."\n"; shift(@list); is(shift(@list),4096,"block size"); -shift(@list); is(shift(@list),1000000,"blocks"); is(shift(@list),500000,"blocks free"); shift(@list);