Project

General

Profile

Actions

Bug #3813

closed

Add Missing RLIMIT_ Constants to Process [Patch]

Added by runpaint (Run Paint Run Run) over 13 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3dev (2010-09-10 trunk 29207) [i686-linux]
Backport:
[ruby-core:32262]

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

rlimit-constants.patch (865 Bytes) rlimit-constants.patch runpaint (Run Paint Run Run), 09/10/2010 07:12 AM
rlimit-constants-sorted.patch (2.1 KB) rlimit-constants-sorted.patch runpaint (Run Paint Run Run), 09/10/2010 07:12 AM
rlimit-constants-2.patch (5.43 KB) rlimit-constants-2.patch runpaint (Run Paint Run Run), 09/12/2010 06:22 AM
Actions #1

Updated by akr (Akira Tanaka) over 13 years ago

=begin
2010/9/10 Run Paint Run Run :

Bug #3813: Add Missing RLIMIT_ Constants to Process [Patch]
http://redmine.ruby-lang.org/issues/show/3813

Author: Run Paint Run Run
Status: Open, Priority: Low
Category: core
ruby -v: ruby 1.9.3dev (2010-09-10 trunk 29207) [i686-linux]

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:

Your patch is not enough for supporting the limits.

rlimit_resource_name2int and the document of Process.setrlimit should be
updated as well.

Tanaka Akira

=end

Actions #2

Updated by runpaint (Run Paint Run Run) over 13 years ago

=begin

Your patch is not enough for supporting the limits.

rlimit_resource_name2int and the document of Process.setrlimit should be
updated as well.

Apologies. Updated patch attached.
=end

Actions #3

Updated by akr (Akira Tanaka) over 13 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r29229.
Run Paint, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0