fixed stat64 support (take II)
PATCH 1/1 fixed stat64 support (take II)
Previous version of this patch added packed attribute, but didn't fix st_ino. Chris's glibc version found this one, too.
Name: Fix stat64
Author: Rusty Russell
Status: Tested
D: PPC64 gets size of x86 stat64 struct wrong due to padding
D: differences. Also, translation of st_ino is incorrect.
syscall-i386.h +1 -1
@@ -330,7 +329,7 @@ struct target_stat64 {target_ulong __pad7;/* will be high 32 bits of ctime someday */ unsigned long long st_ino; -}; +} __attribute__((packed));#define TARGET_SA_NOCLDSTOP 0x00000001#define TARGET_SA_NOCLDWAIT 0x00000002/* not supported yet */
syscall.c +1 -1
@@ -2257,7 +2257,7 @@ long do_syscall(void *cpu_env, int num,struct target_stat64 *target_st = (void *)arg2;memset (target_st,0 ,sizeof (struct target_stat64 )); target_st->st_dev =tswap16 (st.st_dev); - target_st->st_ino =tswapl (st.st_ino); + target_st->st_ino =tswap64 (st.st_ino);#ifdef TARGET_STAT64_HAS_BROKEN_ST_INO target_st->__st_ino =tswapl (st.st_ino);#endif
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.