qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Riku Voipio <riku.voipio@iki.fi>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] add futimesat syscall
Date: Wed, 17 Sep 2008 22:45:33 +0300	[thread overview]
Message-ID: <20080917194533.GB21187@kos.to> (raw)

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

Add futimes patch, originally from scratchbox qemu devkit.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>

-- 
"rm -rf" only sounds scary if you don't have backups

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

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;

             reply	other threads:[~2008-09-17 19:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-17 19:45 Riku Voipio [this message]
2008-09-17 23:54 ` [Qemu-devel] [PATCH] add futimesat syscall andrzej zaborowski
2008-09-18  5:00   ` Kirill A. Shutemov
2008-09-18  6:30   ` Riku Voipio
2008-09-18  7:23     ` Laurent Desnogues
2008-09-18  9:08       ` Riku Voipio
2008-09-18  9:28         ` Kirill A. Shutemov
2008-09-18  9:42           ` Riku Voipio
2008-09-18 10:16             ` Kirill A. Shutemov
2008-09-18 11:13               ` Thiemo Seufer
2008-09-18 11:45                 ` Kirill A. Shutemov

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=20080917194533.GB21187@kos.to \
    --to=riku.voipio@iki.fi \
    --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).