Bug #3813
closedAdd Missing RLIMIT_ Constants to Process [Patch]
Description
=begin
This patch adds the five missing RLIMIT_* constants to Process. As of Linux 2.6.32, man 2 getrlimit
defines 16 RLIMIT_* constants. 1 of those is obsolete. With this patch, Process knows these 15 plus the FreeBSD-specific RLIMIT_SBSIZE. My kernel isn't configured for RLIMIT_RTTIME, but the following shows that the remaining 14 work:
pp Hash[*Process.constants.grep(/RLIMIT/).
flat_map{|c| [c, Process.getrlimit(Process.const_get(c))]}]
{:RLIMIT_AS=>[18446744073709551615, 18446744073709551615],
:RLIMIT_CORE=>[0, 18446744073709551615],
:RLIMIT_CPU=>[18446744073709551615, 18446744073709551615],
:RLIMIT_DATA=>[18446744073709551615, 18446744073709551615],
:RLIMIT_FSIZE=>[18446744073709551615, 18446744073709551615],
:RLIMIT_MEMLOCK=>[65536, 65536],
:RLIMIT_MSGQUEUE=>[819200, 819200],
:RLIMIT_NICE=>[20, 20],
:RLIMIT_NOFILE=>[1024, 1024],
:RLIMIT_NPROC=>[18446744073709551615, 18446744073709551615],
:RLIMIT_RSS=>[18446744073709551615, 18446744073709551615],
:RLIMIT_RTPRIO=>[0, 0],
:RLIMIT_SIGPENDING=>[16382, 16382],
:RLIMIT_STACK=>[8388608, 18446744073709551615]}
The second patch, 'rlimit-constants-sorted.patch', adds the new constants and sorts the list alphabetically.
=end
Files