This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: setrlimit change to prlimit change in behavior?


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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]