[Top][All Lists]

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

Why does get_lim_data ignore RLIM_INFINITY?

From: Ken Brown
Subject: Why does get_lim_data ignore RLIM_INFINITY?
Date: Tue, 19 Mar 2013 23:03:38 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2


I'm puzzled by one of the changes you made to vm-limit.c:get_lim_data() in bzr revision 111152. Specifically, it doesn't seem right to ignore RLIM_INFINITY as in the following comment:

+  /* Set LIM_DATA to the minimum of the maximum object size and the
+     maximum address space.  Don't bother to check for values like
+ RLIM_INFINITY since in practice they are not much less than SIZE_MAX. */

According to POSIX, "If a call to getrlimit() returns RLIM_INFINITY for a resource, it means the implementation shall not enforce limits on that resource."

So I think this fragment of the original code shouldn't have been removed:

if (rlimit.rlim_cur == RLIM_INFINITY)
 lim_data = -1;


reply via email to

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