setrlimit change to prlimit change in behavior?
Andreas Schwab
schwab@suse.de
Wed Oct 18 15:04:00 GMT 2017
On Okt 18 2017, Mark Wielaard <mark@klomp.org> wrote:
> On Wed, 2017-10-18 at 16:13 +0200, Andreas Schwab wrote:
>> On Okt 18 2017, Mark Wielaard <mark@klomp.org> wrote:
>>
>> > The valgrind testsuite has a testcase that checks that
>> > Â setrlimit (RLIMIT_NOFILE, NULL)
>> > returns failure and sets errno to EFAULT.
>>
>> In general, you cannot count on EFAULT.  The call has undefined
>> behaviour, thus unbounded effect (a crash would be ok too).
>
> Interesting. I didn't know undefined behavior extended to the Posix
> functions. So does this hold for all functions defined by Posix that
> have pointer arguments that are outside the accessible address space?
If there is no special case for NULL then it is not allowed.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
More information about the Libc-alpha
mailing list