On 13.02.2015 17:29, Bruce Evans wrote:
>> if (arg < 0) {
>>errno = EINVAL;
>>return (-1);
>> }
>
>
> This is reasonable, but not encouraged by the API or compatible with
> what setrlimit() does with negative args. (setrlimit() still uses
> my hack from 1994, of converting negative args
On 02/13/15 11:46, Bruce Evans wrote:
On Fri, 13 Feb 2015, Pedro Giffuni wrote:
On 02/13/15 09:29, Bruce Evans wrote:
On Fri, 13 Feb 2015, Andrey Chernov wrote:
We even don't need to check arg excepting for < 0, because what is
needed is rlimt_t and not arg. So this version will be better:
On Fri, 13 Feb 2015, Pedro Giffuni wrote:
On 02/13/15 09:29, Bruce Evans wrote:
On Fri, 13 Feb 2015, Andrey Chernov wrote:
We even don't need to check arg excepting for < 0, because what is
needed is rlimt_t and not arg. So this version will be better:
rlimt_t targ;
if (arg < 0) {
errno
On 02/13/15 09:29, Bruce Evans wrote:
On Fri, 13 Feb 2015, Andrey Chernov wrote:
We even don't need to check arg excepting for < 0, because what is
needed is rlimt_t and not arg. So this version will be better:
rlimt_t targ;
if (arg < 0) {
errno = EINVAL;
return (-1);
}
This is reas
On Sat, 14 Feb 2015, Bruce Evans wrote:
...
However, I don't like using rlim_t for the scaled value that is not
an rlimit.
An incomplete fix with handling of negative values restored is something
like:
intmax_t targ;
targ = arg;
if (targ > RLIM_INFINITY / 512)
On Fri, 13 Feb 2015, Andrey Chernov wrote:
We even don't need to check arg excepting for < 0, because what is
needed is rlimt_t and not arg. So this version will be better:
rlimt_t targ;
if (arg < 0) {
errno = EINVAL;
return (-1);
}
This is reasonable, but not encouraged by the API or
On Fri, 13 Feb 2015, Andrey Chernov wrote:
On 13.02.2015 10:18, Bruce Evans wrote:
if (arg > RLIM_INFINITY)
err(...);
Checking for RLIM_INFINITY is wrong here, since it is ulong long max,
No, it is correct. rlim_t is neither unsigned not specificially
ulong long. It is int64_t
We even don't need to check arg excepting for < 0, because what is
needed is rlimt_t and not arg. So this version will be better:
rlimt_t targ;
if (arg < 0) {
errno = EINVAL;
return (-1);
}
targ = arg;
if (targ > RLIM_INFINITY / 512)
targ = RLIM_INFINITY / 512;
limit.rlim_max = limit.
On 13.02.2015 10:18, Bruce Evans wrote:
> if (arg > RLIM_INFINITY)
> err(...);
Checking for RLIM_INFINITY is wrong here, since it is ulong long max,
considering
arg = va_arg(ap, long);
and ulimit(3) stating that arg is always plain long.
Proper check will be
if (arg < 0) {
errno
On Thu, 12 Feb 2015, Bjoern A. Zeeb wrote:
On 12 Feb 2015, at 22:34 , Pedro Giffuni wrote:
On 02/12/15 17:27, Bjoern A. Zeeb wrote:
On 12 Feb 2015, at 21:07 , Pedro F. Giffuni wrote:
...
Log:
ulimit(3): Fix broken check.
...
Did this compile?
Yes! Any log message to share?
Now I do ag
On 02/12/15 18:54, Garrett Cooper wrote:
On Feb 12, 2015, at 15:14, Pedro Giffuni wrote:
On 02/12/15 17:44, Bjoern A. Zeeb wrote:
On 12 Feb 2015, at 22:34 , Pedro Giffuni wrote:
...
Thank you!
This will sound strange but I can't confirm, and I can't see anything
obviously wrong.
I have
On Feb 12, 2015, at 15:14, Pedro Giffuni wrote:
> On 02/12/15 17:44, Bjoern A. Zeeb wrote:
>>> On 12 Feb 2015, at 22:34 , Pedro Giffuni wrote:
...
> Thank you!
>
> This will sound strange but I can't confirm, and I can't see anything
> obviously wrong.
>
> I have the revert ready but let me
On 02/12/15 17:44, Bjoern A. Zeeb wrote:
On 12 Feb 2015, at 22:34 , Pedro Giffuni wrote:
On 02/12/15 17:27, Bjoern A. Zeeb wrote:
On 12 Feb 2015, at 21:07 , Pedro F. Giffuni wrote:
Author: pfg
Date: Thu Feb 12 21:07:42 2015
New Revision: 278634
URL: https://svnweb.freebsd.org/changeset/bas
> On 12 Feb 2015, at 22:34 , Pedro Giffuni wrote:
>
>
> On 02/12/15 17:27, Bjoern A. Zeeb wrote:
>>> On 12 Feb 2015, at 21:07 , Pedro F. Giffuni wrote:
>>>
>>> Author: pfg
>>> Date: Thu Feb 12 21:07:42 2015
>>> New Revision: 278634
>>> URL: https://svnweb.freebsd.org/changeset/base/278634
>>>
On 02/12/15 17:27, Bjoern A. Zeeb wrote:
On 12 Feb 2015, at 21:07 , Pedro F. Giffuni wrote:
Author: pfg
Date: Thu Feb 12 21:07:42 2015
New Revision: 278634
URL: https://svnweb.freebsd.org/changeset/base/278634
Log:
ulimit(3): Fix broken check.
The existing implementation had a broken com
> On 12 Feb 2015, at 21:07 , Pedro F. Giffuni wrote:
>
> Author: pfg
> Date: Thu Feb 12 21:07:42 2015
> New Revision: 278634
> URL: https://svnweb.freebsd.org/changeset/base/278634
>
> Log:
> ulimit(3): Fix broken check.
>
> The existing implementation had a broken comparison that could over
Author: pfg
Date: Thu Feb 12 21:07:42 2015
New Revision: 278634
URL: https://svnweb.freebsd.org/changeset/base/278634
Log:
ulimit(3): Fix broken check.
The existing implementation had a broken comparison that could overflow.
Replace this with a check that avoids the overflow before it hap
17 matches
Mail list logo