[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does get_lim_data ignore RLIM_INFINITY?

From: Paul Eggert
Subject: Re: Why does get_lim_data ignore RLIM_INFINITY?
Date: Tue, 19 Mar 2013 22:36:37 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4

On 03/19/2013 08:03 PM, Ken Brown wrote:

> So I think this fragment of the original code shouldn't have been removed:
> if (rlimit.rlim_cur == RLIM_INFINITY)
>  lim_data = -1;

If rlim_cur == RLIM_INFINITY, then in practice rlim_cur is either
greater than SIZE_MAX (in which case the surrounding code will
treat it as if it were SIZE_MAX, which is the same as (size_t) -1),
or it is so close to SIZE_MAX that Emacs won't care about the difference.
In either case, the above if-statement isn't needed.

It's true that POSIX doesn't guarantee this practical property of RLIM_INFINITY,
but it's also true that various POSIX implementations have squirrelly
nearly-RLIM_INFINITY values such as RLIM_SAVED_MAX that the code needs
to work with, and the hassle of dealing with this variation
"correctly" is probably more trouble than it's worth, since (unless
I'm missing something) the code works as-is.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]