Skip to contentSkip to conversation

target arm fstat64 bug

Qemu-devel matthieu castet 2 participants 3 messages Jul 16, 2008 – Jul 19, 2008

lore
Share & tools
lore
#0 lore raw

Hi,

it seems there a problem with fstat64 struct. __pad2 should be 4 not 8 :
before it was :

    unsigned short  st_rdev;
    unsigned char   __pad3[10];

now sizeof st_rdev = 8, so we take 6 bytes to __pad3. This match linux kernel declaration.

syscall_defs.h (working copy) renamed from syscall_defs.h (revision 4881) +1 -1
Index: linux-user/syscall_defs.h
===================================================================
@@ -962,7 +962,7 @@
         abi_ulong    st_gid;
 
         unsigned long long st_rdev;
-        unsigned int    __pad2[2];
+        unsigned int    __pad2;
 
         long long       st_size;
         abi_ulong    st_blksize;
#2 lore raw
In reply to matthieu castet

2008/7/16 matthieu castet <[email protected]>:

Quoted 14 lines

Hi,

it seems there a problem with fstat64 struct. __pad2 should be 4 not 8 :
before it was :

   unsigned short  st_rdev;
   unsigned char   __pad3[10];

now sizeof st_rdev = 8, so we take 6 bytes to __pad3. This match linux kernel declaration.

Index: linux-user/syscall_defs.h
===================================================================

syscall_defs.h (working copy) line 965

Quoted 5 lines
syscall_defs.h (working copy) renamed from syscall_defs.h (revision 4881) +1 -1
@@ -962,7 +962,7 @@
        abi_ulong    st_gid;
 
        unsigned long long st_rdev;
-        unsigned int    __pad2[2];
+        unsigned int    __pad2;

Is it ok to use int here at all? Also in the kernel I'm looking at there's no padding between .st_blksize and .st_blocks.

Regards