qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thayne Harbaugh <thayne@c2.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] linux-user futimesat() syscall
Date: Tue, 02 Oct 2007 14:50:46 -0600	[thread overview]
Message-ID: <1191358246.5200.94.camel@phantasm.home.enterpriseandprosperity.com> (raw)
In-Reply-To: <1190206395.9564.94.camel@phantasm.home.enterpriseandprosperity.com>

[-- Attachment #1: Type: text/plain, Size: 441 bytes --]

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.

[-- Attachment #2: 23_futimesat.patch --]
[-- Type: text/x-patch, Size: 2769 bytes --]

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

  parent reply	other threads:[~2007-10-02 20:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19 12:46 [Qemu-devel] [PATCH] linux-user *at() syscalls Thayne Harbaugh
2007-09-19 12:51 ` [Qemu-devel] Re: [PATCH] linux-user utimensat() syscall Thayne Harbaugh
2007-09-19 12:53   ` [Qemu-devel] Re: [PATCH] linux-user futimesat() syscall Thayne Harbaugh
2007-09-19 12:54     ` [Qemu-devel] Re: [PATCH] linux-user openat() syscall Thayne Harbaugh
2007-09-19 12:57       ` [Qemu-devel] Re: [PATCH] linux-user mkdirat() syscall Thayne Harbaugh
2007-09-19 12:58         ` [Qemu-devel] Re: [PATCH] linux-user mknodat() syscall Thayne Harbaugh
2007-09-19 12:59           ` [Qemu-devel] Re: [PATCH] linux-user fchownat() syscall Thayne Harbaugh
2007-09-19 13:00             ` [Qemu-devel] Re: [PATCH] linux-user unlinkat() syscall Thayne Harbaugh
2007-09-19 13:01               ` [Qemu-devel] Re: [PATCH] linux-user renameat() syscall Thayne Harbaugh
2007-09-19 13:02                 ` [Qemu-devel] Re: [PATCH] linux-user linkat() syscall Thayne Harbaugh
2007-09-19 13:03                   ` [Qemu-devel] Re: [PATCH] linux-user symlinkat() syscall Thayne Harbaugh
2007-09-19 13:04                     ` [Qemu-devel] Re: [PATCH] linux-user readlinkat() syscall Thayne Harbaugh
2007-09-19 13:05                       ` [Qemu-devel] Re: [PATCH] linux-user fchmodat() syscall Thayne Harbaugh
2007-09-19 13:06                         ` [Qemu-devel] Re: [PATCH] linux-user faccessat() syscall Thayne Harbaugh
2007-09-19 13:09                           ` [Qemu-devel] Re: [PATCH] linux-user stat64_put_user function Thayne Harbaugh
2007-09-19 13:11                             ` [Qemu-devel] Re: [PATCH] linux-user fstatat syscall Thayne Harbaugh
2007-10-02 20:50     ` Thayne Harbaugh [this message]
2007-09-23 15:42   ` [Qemu-devel] Re: [PATCH] linux-user utimensat() syscall Thiemo Seufer
2007-09-23 16:58     ` Stuart Anderson
2007-09-24 19:45       ` Thayne Harbaugh
2007-09-25  4:25         ` Thayne Harbaugh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1191358246.5200.94.camel@phantasm.home.enterpriseandprosperity.com \
    --to=thayne@c2.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).