Bug 416285

Summary: Use prlimit64 in VG_(getrlimit) and VG_(setrlimit)
Product: [Developer tools] valgrind Reporter: Stefan Maksimovic <stefan.maksimovic>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal CC: mark, mips32r2
Priority: NOR    
Version First Reported In: 3.15 SVN   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: patch

Description Stefan Maksimovic 2020-01-15 10:56:23 UTC
Created attachment 125143 [details]
patch

Amend the recent update to VG_(getrlimit) and VG_(setrlimit)

[get|set]rlimit system calls are becoming deprecated.
Coregrind should use prlimit64 as the first candidate in order to achieve
"rlimit" functionality.

There are also systems that do not even support older "rlimits".

Modify the previously added support VG_(getrlimit)
and VG_(setrlimit) using __NR_prlimit64 by making it
similar to the glibc implementation.




This change has been tested on x86 and mips and we would like feedback on how
it behaves on other architectures/systems.
Comment 1 Stefan Maksimovic 2020-02-06 16:31:10 UTC
Did anyone have a chance to take a look at this in the meantime?
Comment 2 Petar Jovanovic 2020-04-17 18:35:42 UTC
Anyone against this patch?
Comment 3 Mark Wielaard 2020-04-23 16:21:28 UTC
This looks correct. Whenever possible we should use prlimit64.