From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kg2y7-00037u-9U for qemu-devel@nongnu.org; Wed, 17 Sep 2008 15:45:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kg2y6-00036m-B9 for qemu-devel@nongnu.org; Wed, 17 Sep 2008 15:45:42 -0400 Received: from [199.232.76.173] (port=58438 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kg2y5-00036f-Vc for qemu-devel@nongnu.org; Wed, 17 Sep 2008 15:45:42 -0400 Received: from [84.20.150.76] (port=43416 helo=narury.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kg2y5-0008V3-RO for qemu-devel@nongnu.org; Wed, 17 Sep 2008 15:45:42 -0400 Received: from kos.to (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by narury.org (Postfix) with ESMTP id 226C4327400F for ; Wed, 17 Sep 2008 22:45:34 +0300 (EEST) Date: Wed, 17 Sep 2008 22:45:33 +0300 From: Riku Voipio Message-ID: <20080917194533.GB21187@kos.to> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1SQmhf2mF2YjsYvc" Content-Disposition: inline Subject: [Qemu-devel] [PATCH] add futimesat syscall 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 --1SQmhf2mF2YjsYvc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Add futimes patch, originally from scratchbox qemu devkit. Signed-off-by: Riku Voipio -- "rm -rf" only sounds scary if you don't have backups --1SQmhf2mF2YjsYvc Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="23_futimesat.patch" Index: trunk/linux-user/syscall.c =================================================================== --- trunk.orig/linux-user/syscall.c 2008-09-16 18:38:15.000000000 +0300 +++ trunk/linux-user/syscall.c 2008-09-17 20:07:40.000000000 +0300 @@ -156,6 +156,7 @@ #define __NR_sys_faccessat __NR_faccessat #define __NR_sys_fchmodat __NR_fchmodat #define __NR_sys_fchownat __NR_fchownat +#define __NR_sys_futimesat __NR_futimesat #define __NR_sys_getcwd1 __NR_getcwd #define __NR_sys_getdents __NR_getdents #define __NR_sys_getdents64 __NR_getdents64 @@ -200,6 +201,10 @@ _syscall5(int,sys_fchownat,int,dirfd,const char *,pathname, uid_t,owner,gid_t,group,int,flags) #endif +#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) #if TARGET_ABI_BITS == 32 _syscall3(int, sys_getdents, uint, fd, struct dirent *, dirp, uint, count); @@ -5743,6 +5748,25 @@ break; #endif +#if defined(TARGET_NR_futimesat) && defined(__NR_futimesat) + case TARGET_NR_futimesat: + { + struct timeval tv[2]; + if (copy_from_user_timeval(tv, arg3) + || copy_from_user_timeval(tv+1, arg3+sizeof(struct target_timeval))) { + goto efault; + } + if (!arg2) + ret = get_errno(sys_futimesat(arg1, NULL, tv)); + else { + p = lock_user_string(arg2); + ret = get_errno(sys_futimesat(arg1, path(p), tv)); + unlock_user(p, arg2, 0); + } + } + break; +#endif + #ifdef TARGET_NR_set_robust_list case TARGET_NR_set_robust_list: goto unimplemented_nowarn; --1SQmhf2mF2YjsYvc--