Subject: Re: linux32 statfs/statfs64
To: Edgar =?iso-8859-1?B?RnXf?= <>
From: Nicolas Joly <>
List: port-amd64
Date: 03/30/2007 22:55:23
On Fri, Mar 30, 2007 at 10:46:28PM +0200, Edgar Fuß wrote:
> >The main problem is that `struct statfs'
> >have different sizes between compat linux and linux32
> Oops?! But my patch pretended to work.

Yes. But you have a broken compat linux statfs syscall ;-)

With your report, i generated a small testcase that showed a problem
for compat linux too. I always prefer to fix native compat linux
before, because it often require some unexpected changes ! And without
fixing it first, i would surely have broken the compat linux32 statfs,
without noticing, a little later :-(

> As I read, the structure is declared as
> struct linux_statfs {
> 	u_int32_t	l_ftype;
> 	u_int32_t	l_fbsize;
> 	u_int32_t	l_fblocks;
> 	u_int32_t	l_fbfree;
> 	u_int32_t	l_fbavail;
> 	u_int32_t	l_ffiles;
> 	u_int32_t	l_fffree;
> 	linux_fsid_t	l_ffsid;
> 	u_int32_t	l_fnamelen;
> 	u_int32_t	l_ffrsize;
> 	u_int32_t	l_fspare[5];
> };
> I must be missing something. Which field width differs
> between 32 bit Linux and 64 bit Linux?

All except one ;-) This is a full 64bit struct.

struct linux_statfs {
        long            l_ftype;
        long            l_fbsize;
        long            l_fblocks;
        long            l_fbfree;
        long            l_fbavail;
        long            l_ffiles;
        long            l_fffree;
        linux_fsid_t    l_ffsid;
        long            l_fnamelen;
        long            l_ffrsize;
        long            l_fspare[5];

Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.