Bug 363680

Summary: add renameat2() support
Product: [Developer tools] valgrind Reporter: Jann Horn <jannhorn>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal CC: mark
Priority: NOR    
Version First Reported In: 3.11.0   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: adds renameat2 support

Description Jann Horn 2016-05-29 23:06:51 UTC
The renameat2() syscall (basically renameat() plus a flags argument) wasn't supported.

I'm going to attach a patch that fixes this if I can figure out how to do that in this bugtracker - it doesn't seem to be possible on the initial page for filing bugs?

Reproducible: Always
Comment 1 Jann Horn 2016-05-29 23:07:57 UTC
Created attachment 99255 [details]
adds renameat2 support

Ah, I can attach stuff after submitting the bug. Attached my patch.
Comment 2 Mark Wielaard 2016-05-30 21:39:03 UTC
Looks correct. It can probably also be added to the other coregrind/m_syswrap/syswrap-*-linux.c wrappers. Do you happen to have an example program that uses renameat2?
Comment 3 Jann Horn 2016-05-30 21:44:08 UTC
No, I don't have an example program - I'm just using it in a private project.
Comment 4 Mark Wielaard 2016-05-31 12:16:45 UTC
I see glibc also doesn't expose it yet. But the code looks fine.
Committed as valgrind svn r15889.
Thanks