From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KggbR-0005O4-Vl for qemu-devel@nongnu.org; Fri, 19 Sep 2008 10:04:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KggbP-0005NS-Bi for qemu-devel@nongnu.org; Fri, 19 Sep 2008 10:04:56 -0400 Received: from [199.232.76.173] (port=59989 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KggbP-0005NN-1p for qemu-devel@nongnu.org; Fri, 19 Sep 2008 10:04:55 -0400 Received: from [84.20.150.76] (port=58255 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 1KggbO-0002y2-KI for qemu-devel@nongnu.org; Fri, 19 Sep 2008 10:04:55 -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 4C2923274001 for ; Fri, 19 Sep 2008 17:04:49 +0300 (EEST) Date: Fri, 19 Sep 2008 17:04:49 +0300 From: Riku Voipio Subject: Re: [Qemu-devel] [PATCH] Implement futimesat() syscall Message-ID: <20080919140449.GC21479@kos.to> References: <1221750426-14863-1-git-send-email-kirill@shutemov.name> <1221750426-14863-2-git-send-email-kirill@shutemov.name> <1221750426-14863-3-git-send-email-kirill@shutemov.name> <1221750426-14863-4-git-send-email-kirill@shutemov.name> <1221750426-14863-5-git-send-email-kirill@shutemov.name> <1221750426-14863-6-git-send-email-kirill@shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1221750426-14863-6-git-send-email-kirill@shutemov.name> 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 On Thu, Sep 18, 2008 at 06:07:04PM +0300, Kirill A. Shutemov wrote: > Signed-off-by: Kirill A. Shutemov Acked-by: Riku Voipio > --- > linux-user/syscall.c | 25 +++++++++++++++++++++++++ > 1 files changed, 25 insertions(+), 0 deletions(-) > > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index ac7e7d9..e90f100 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -157,6 +157,7 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \ > #define __NR_sys_fchmodat __NR_fchmodat > #define __NR_sys_fchownat __NR_fchownat > #define __NR_sys_fstatat64 __NR_fstatat64 > +#define __NR_sys_futimesat __NR_futimesat > #define __NR_sys_getcwd1 __NR_getcwd > #define __NR_sys_getdents __NR_getdents > #define __NR_sys_getdents64 __NR_getdents64 > @@ -205,6 +206,10 @@ _syscall5(int,sys_fchownat,int,dirfd,const char *,pathname, > _syscall4(int,sys_fstatat64,int,dirfd,const char *,pathname, > struct stat *,buf,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); > @@ -3662,6 +3667,26 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, > unlock_user(p, arg1, 0); > } > break; > +#if defined(TARGET_NR_futimesat) && defined(__NR_futimesat) > + case TARGET_NR_futimesat: > + { > + struct timeval *tvp, tv[2]; > + if (arg3) { > + if (copy_from_user_timeval(&tv[0], arg3) > + || copy_from_user_timeval(&tv[1], > + arg3 + sizeof(struct target_timeval))) > + goto efault; > + tvp = tv; > + } else { > + tvp = NULL; > + } > + if (!(p = lock_user_string(arg2))) > + goto efault; > + ret = get_errno(sys_futimesat(arg1, path(p), tvp)); > + unlock_user(p, arg2, 0); > + } > + break; > +#endif > #ifdef TARGET_NR_stty > case TARGET_NR_stty: > goto unimplemented; > -- > 1.5.6.5.GIT > > -- "rm -rf" only sounds scary if you don't have backups