From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Icop7-0006op-7X for qemu-devel@nongnu.org; Tue, 02 Oct 2007 16:58:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Icop2-0006nD-LS for qemu-devel@nongnu.org; Tue, 02 Oct 2007 16:58:32 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Icop2-0006n8-Ib for qemu-devel@nongnu.org; Tue, 02 Oct 2007 16:58:28 -0400 Received: from owa.c2.net ([207.235.78.2] helo=email.c2.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Icop0-0006YW-5n for qemu-devel@nongnu.org; Tue, 02 Oct 2007 16:58:28 -0400 From: Thayne Harbaugh In-Reply-To: <1190206395.9564.94.camel@phantasm.home.enterpriseandprosperity.com> References: <1190205992.9564.88.camel@phantasm.home.enterpriseandprosperity.com> <1190206302.9564.91.camel@phantasm.home.enterpriseandprosperity.com> <1190206395.9564.94.camel@phantasm.home.enterpriseandprosperity.com> Content-Type: multipart/mixed; boundary="=-Nulq73Vf/4X6O/JEBuR1" Date: Tue, 02 Oct 2007 14:50:46 -0600 Message-Id: <1191358246.5200.94.camel@phantasm.home.enterpriseandprosperity.com> Mime-Version: 1.0 Subject: [Qemu-devel] Re: [PATCH] linux-user futimesat() syscall Reply-To: thayne@c2.net, 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 --=-Nulq73Vf/4X6O/JEBuR1 Content-Type: text/plain Content-Transfer-Encoding: 7bit On Wed, 2007-09-19 at 06:53 -0600, Thayne Harbaugh wrote: > This patch adds the futimesat syscall to linux-user. The previous futimesat() patch that was sent was horribly brain-damaged: it used timespec in a few places that should have used timeval. This is a corrected patch. I'm sure the previous patch was composed and sent by my evil twin from a parallel universe. I will find him and discipline him appropriately. Yeah, that's it. --=-Nulq73Vf/4X6O/JEBuR1 Content-Disposition: attachment; filename=23_futimesat.patch Content-Type: text/x-patch; name=23_futimesat.patch; charset=utf-8 Content-Transfer-Encoding: 7bit Index: qemu/linux-user/syscall.c =================================================================== --- qemu.orig/linux-user/syscall.c 2007-09-28 13:08:43.000000000 -0600 +++ qemu/linux-user/syscall.c 2007-10-02 14:56:47.000000000 -0600 @@ -151,6 +151,7 @@ #define __NR_sys_uname __NR_uname +#define __NR_sys_futimesat __NR_futimesat #define __NR_sys_getcwd1 __NR_getcwd #define __NR_sys_getdents __NR_getdents #define __NR_sys_getdents64 __NR_getdents64 @@ -172,6 +173,10 @@ } #endif _syscall1(int,sys_uname,struct new_utsname *,buf) +#if defined(TARGET_NR_futimesat) && defined(__NR_futimesat) +_syscall3(int,sys_futimesat,int,dirfd,const char *,pathname, + const struct timeval *,times) +#endif _syscall2(int,sys_getcwd1,char *,buf,size_t,size) _syscall3(int, sys_getdents, uint, fd, struct dirent *, dirp, uint, count); #if defined(TARGET_NR_getdents64) && defined(__NR_getdents64) @@ -4873,6 +4878,30 @@ break; #endif +#if defined(TARGET_NR_futimesat) && defined(__NR_futimesat) + case TARGET_NR_futimesat: + { + struct timeval tv[2]; + if (copy_from_user_timeval(tv, (struct target_timeval *)arg3) + || copy_from_user_timeval(tv+1, (struct target_timeval *)arg3+1)) { + ret = -EFAULT; + goto fail; + } + if (!arg2) + ret = get_errno(sys_futimesat(arg1, NULL, tv)); + else { + p = lock_user_string(arg2); + if (!access_ok(VERIFY_READ, p, 1)) + ret = -EFAULT; + else + ret = get_errno(sys_futimesat(arg1, path(p), tv)); + if (p) + unlock_user(p, arg2, 0); + } + } + break; +#endif + #ifdef TARGET_NR_set_robust_list case TARGET_NR_set_robust_list: goto unimplemented_nowarn; Index: qemu/linux-user/arm/syscall_nr.h =================================================================== --- qemu.orig/linux-user/arm/syscall_nr.h 2007-09-28 13:08:43.000000000 -0600 +++ qemu/linux-user/arm/syscall_nr.h 2007-10-02 14:54:56.000000000 -0600 @@ -325,4 +325,5 @@ #define TARGET_NR_mbind 319 #define TARGET_NR_get_mempolicy 320 #define TARGET_NR_set_mempolicy 321 +#define TARGET_NR_futimesat 326 #define TARGET_NR_utimensat 348 Index: qemu/linux-user/i386/syscall_nr.h =================================================================== --- qemu.orig/linux-user/i386/syscall_nr.h 2007-09-28 13:08:43.000000000 -0600 +++ qemu/linux-user/i386/syscall_nr.h 2007-10-02 14:54:56.000000000 -0600 @@ -274,6 +274,8 @@ #define TARGET_NR_tgkill 270 #define TARGET_NR_utimes 271 +#define TARGET_NR_futimesat 299 + #define TARGET_NR_set_robust_list 311 #define TARGET_NR_utimensat 320 --=-Nulq73Vf/4X6O/JEBuR1--