On Thu, 21 Dec 2017 06:01:25 PST (-0800), peter.mayd...@linaro.org wrote:
On 20 December 2017 at 00:29, Palmer Dabbelt <pal...@dabbelt.com> 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?