From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HloAI-0006DA-Ah for qemu-devel@nongnu.org; Wed, 09 May 2007 11:33:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HloAG-0006Cr-Sn for qemu-devel@nongnu.org; Wed, 09 May 2007 11:33:18 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HloAG-0006Co-MC for qemu-devel@nongnu.org; Wed, 09 May 2007 11:33:16 -0400 Received: from ns.suse.de ([195.135.220.2] helo=mx1.suse.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Hlo33-0007Bv-13 for qemu-devel@nongnu.org; Wed, 09 May 2007 11:25:49 -0400 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 192F1122EE for ; Wed, 9 May 2007 17:25:46 +0200 (CEST) Message-ID: <4641E856.9080507@suse.de> Date: Wed, 09 May 2007 17:27:18 +0200 From: Alexander Graf MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080902060500050905050606" Subject: [Qemu-devel] [PATCH] fadvise64 support Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------080902060500050905050606 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, this patch should implement fadvise64 and fadvise64_64 syscall support for at least i386 by mapping it to the host syscall. While trying out a current glibc version with qemu-i386 it just annoyed me to get an unsupported syscall for this. Hope this helps, Alex --------------080902060500050905050606 Content-Type: text/x-patch; name="qemu-0.9.0-fadvise64.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-0.9.0-fadvise64.patch" Index: qemu-0.9.0/linux-user/syscall.c =================================================================== --- qemu-0.9.0.orig/linux-user/syscall.c +++ qemu-0.9.0/linux-user/syscall.c @@ -144,6 +144,7 @@ type name (type1 arg1,type2 arg2,type3 a #define __NR_sys_getdents64 __NR_getdents64 #define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo #define __NR_sys_syslog __NR_syslog +#define __NR_sys_fadvise64 __NR_fadvise64 #if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__) #define __NR__llseek __NR_lseek @@ -164,6 +165,7 @@ _syscall5(int, _llseek, uint, fd, ulon loff_t *, res, uint, wh); _syscall3(int,sys_rt_sigqueueinfo,int,pid,int,sig,siginfo_t *,uinfo) _syscall3(int,sys_syslog,int,type,char*,bufp,int,len) +_syscall4(int,sys_fadvise64,int,fd,loff_t,offset,loff_t,len,int,advice) #ifdef __NR_exit_group _syscall1(int,exit_group,int,error_code) #endif @@ -4151,6 +4153,17 @@ long do_syscall(void *cpu_env, int num, break; } #endif +#ifdef TARGET_NR_fadvise64 + case TARGET_NR_fadvise64: + ret = get_errno(sys_fadvise64((int)arg1, arg2, arg3, (int)arg4)); + break; +#endif +#ifdef TARGET_NR_fadvise64_64 + case TARGET_NR_fadvise64_64: + // fadvise64_64 should be just a wrapper for fadvise_64 + ret = get_errno(sys_fadvise64((int)arg1, arg2, arg3, (int)arg4)); + break; +#endif default: unimplemented: gemu_log("qemu: Unsupported syscall: %d\n", num); Index: qemu-0.9.0/linux-user/i386/syscall_nr.h =================================================================== --- qemu-0.9.0.orig/linux-user/i386/syscall_nr.h +++ qemu-0.9.0/linux-user/i386/syscall_nr.h @@ -272,3 +272,4 @@ #define TARGET_NR_clock_nanosleep (TARGET_NR_timer_create+8) #define TARGET_NR_utimes 271 +#define TARGET_NR_fadvise64_64 272 --------------080902060500050905050606--