Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IXz8U-0002iV-Ll for qemu-devel@nongnu.org; Wed, 19 Sep 2007 08:58:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IXz8T-0002hN-Ez for qemu-devel@nongnu.org; Wed, 19 Sep 2007 08:58:34 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IXz8T-0002hK-CY for qemu-devel@nongnu.org; Wed, 19 Sep 2007 08:58:33 -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 1IXz8T-00088j-06 for qemu-devel@nongnu.org; Wed, 19 Sep 2007 08:58:33 -0400 From: Thayne Harbaugh In-Reply-To: <1190205992.9564.88.camel@phantasm.home.enterpriseandprosperity.com> References: <1190205992.9564.88.camel@phantasm.home.enterpriseandprosperity.com> Content-Type: multipart/mixed; boundary="=-C+yU7HqMCxgHcLsxYch/" Date: Wed, 19 Sep 2007 06:51:42 -0600 Message-Id: <1190206302.9564.91.camel@phantasm.home.enterpriseandprosperity.com> Mime-Version: 1.0 Subject: [Qemu-devel] Re: [PATCH] linux-user utimensat() 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 --=-C+yU7HqMCxgHcLsxYch/ Content-Type: text/plain Content-Transfer-Encoding: 7bit This patch adds the utimensat syscall to linux-user. --=-C+yU7HqMCxgHcLsxYch/ Content-Disposition: attachment; filename=22_utimensat.patch Content-Type: text/x-patch; name=22_utimensat.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: qemu/linux-user/syscall.c =================================================================== --- qemu.orig/linux-user/syscall.c 2007-09-19 06:16:40.000000000 -0600 +++ qemu/linux-user/syscall.c 2007-09-19 06:17:45.000000000 -0600 @@ -158,6 +158,7 @@ #define __NR_sys_syslog __NR_syslog #define __NR_sys_tgkill __NR_tgkill #define __NR_sys_tkill __NR_tkill +#define __NR_sys_utimensat __NR_utimensat #if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__) #define __NR__llseek __NR_lseek @@ -192,6 +193,10 @@ #if defined(TARGET_NR_set_tid_address) && defined(__NR_set_tid_address) _syscall1(int,set_tid_address,int *,tidptr) #endif +#if defined(TARGET_NR_utimensat) && defined(__NR_utimensat) +_syscall4(int,sys_utimensat,int,dirfd,const char *,pathname, + const struct timespec *,tsp,int,flags) +#endif extern int personality(int); extern int flock(int, int); @@ -4873,6 +4878,30 @@ goto unimplemented_nowarn; #endif +#if defined(TARGET_NR_utimensat) && defined(__NR_utimensat) + case TARGET_NR_utimensat: + { + struct timespec ts[2]; + if (copy_from_user_timespec(ts, (struct target_timespec *)arg3) + || copy_from_user_timespec(ts+1, (struct target_timespec *)arg3+1)) { + ret = -EFAULT; + goto fail; + } + if (!arg2) + ret = get_errno(sys_utimensat(arg1, NULL, ts, arg4)); + else { + p = lock_user_string(arg2); + if (!access_ok(VERIFY_READ, p, 1)) + ret = -EFAULT; + else + ret = get_errno(sys_utimensat(arg1, path(p), ts, arg4)); + if (p) + unlock_user(p, arg2, 0); + } + } + break; +#endif + default: unimplemented: gemu_log("qemu: Unsupported syscall: %d\n", num); Index: qemu/linux-user/arm/syscall_nr.h =================================================================== --- qemu.orig/linux-user/arm/syscall_nr.h 2007-09-18 23:36:22.000000000 -0600 +++ qemu/linux-user/arm/syscall_nr.h 2007-09-19 06:17:18.000000000 -0600 @@ -325,3 +325,4 @@ #define TARGET_NR_mbind 319 #define TARGET_NR_get_mempolicy 320 #define TARGET_NR_set_mempolicy 321 +#define TARGET_NR_utimensat 348 --=-C+yU7HqMCxgHcLsxYch/--