qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] linux-user: Implement renameat2 when defined


From: Palmer Dabbelt
Subject: Re: [Qemu-devel] [PATCH] linux-user: Implement renameat2 when defined
Date: Thu, 21 Dec 2017 08:29:44 -0800 (PST)

On Thu, 21 Dec 2017 06:01:25 PST (-0800), address@hidden wrote:
On 20 December 2017 at 00:29, Palmer Dabbelt <address@hidden> wrote:
+#if defined(TARGET_NR_renameat2) && defined(__NR_renameat2)
+    case TARGET_NR_renameat2:
+        {
+            void *p2;
+            p  = lock_user_string(arg2);
+            p2 = lock_user_string(arg4);
+            if (!p || !p2)
+                ret = -TARGET_EFAULT;
+            else
+                ret = get_errno(syscall(__NR_renameat2, arg1, p, arg3, p2, 
arg5));
+            unlock_user(p2, arg4, 0);
+            unlock_user(p, arg2, 0);
+        }
+        break;
+#endif

Should we have code to handle using plain renameat for flags==0
calls? renameat2() only arrived in 3.15 kernels, so as it stands
this patch will work on a smaller set of hosts than it might.

That sound sane: there isn't even a glibc wrapper for renameat2, so I assume most calls will be with flags==0. Do you want me to re-spin the patch, or can you take it from here?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]