int
linux_renameat(struct thread *td, struct linux_renameat_args *args)
+{
+ struct linux_renameat2_args renameat2_args = {
+ .olddfd = args->olddfd,
+ .oldname = args->oldname,
+ .newdfd = args->newdfd,
+ .newname = args->newname,
+ .flags = 0
+ };
+
+ return (linux_renameat2(td, &renameat2_args));
+}
+
+int
+linux_renameat2(struct thread *td, struct linux_renameat2_args *args)
{
char *from, *to;
int error, olddfd, newdfd;
+ if (args->flags != 0) {
+ linux_msg(td, "renameat2 unsupported flags 0x%x\n",
+ args->flags);
+ return (EINVAL);
+ }
+
olddfd = (args->olddfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->olddfd;
newdfd = (args->newdfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->newdfd;
LCONVPATHEXIST_AT(td, args->oldname, &from, olddfd);