From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 198FUy-0007eO-00 for qemu-devel@nongnu.org; Wed, 23 Apr 2003 04:21:00 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 198FTw-0006hg-00 for qemu-devel@nongnu.org; Wed, 23 Apr 2003 04:19:57 -0400 Received: from dp.samba.org ([66.70.73.150] helo=lists.samba.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 198FQK-0005fS-00 for qemu-devel@nongnu.org; Wed, 23 Apr 2003 04:16:12 -0400 From: Rusty Russell Date: Wed, 23 Apr 2003 18:15:45 +1000 Sender: rusty@rustcorp.com.au Message-Id: <20030423081611.DF33C2C0A5@lists.samba.org> Subject: [Qemu-devel] [PATCH] fixed stat64 support (take II) List-Id: List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , To: Fabrice Bellard Cc: cyeoh@samba.org, qemu-devel@nongnu.org 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. diff -urpN --exclude TAGS -X /home/rusty/current-dontdiff --minimal qemu-0.1.6/syscall-i386.h qemu-0.1.6-debug/syscall-i386.h --- qemu-0.1.6/syscall-i386.h 2003-04-11 11:01:57.000000000 +1000 +++ qemu-0.1.6-debug/syscall-i386.h 2003-04-23 17:39:27.000000000 +1000 @@ -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 */ diff -urpN --exclude TAGS -X /home/rusty/current-dontdiff --minimal qemu-0.1.6/syscall.c qemu-0.1.6-debug/syscall.c --- qemu-0.1.6/syscall.c 2003-04-11 11:01:57.000000000 +1000 +++ qemu-0.1.6-debug/syscall.c 2003-04-23 17:41:01.000000000 +1000 @@ -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.