Skip to content

Commit

Permalink
[Truffle] Add Process::Constants
Browse files Browse the repository at this point in the history
  • Loading branch information
bjfish committed May 27, 2015
1 parent 6c0982f commit d5252c6
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/process/constants_tags.txt

This file was deleted.

12 changes: 12 additions & 0 deletions spec/truffle/tags/core/process/getrlimit_tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,15 @@ fails:Process.getrlimit when passed a String coerces 'RSS' into RLIMIT_RSS
fails:Process.getrlimit when passed a String raises ArgumentError when passed an unknown resource
fails:Process.getrlimit when passed on Object calls #to_str to convert to a String
fails:Process.getrlimit when passed on Object calls #to_int if #to_str does not return a String
fails:Process.getrlimit when passed a Symbol coerces :SBSIZE into RLIMIT_SBSIZE
fails:Process.getrlimit when passed a Symbol coerces :RTTIME into RLIMIT_RTTIME
fails:Process.getrlimit when passed a Symbol coerces :MSGQUEUE into RLIMIT_MSGQUEUE
fails:Process.getrlimit when passed a Symbol coerces :SIGPENDING into RLIMIT_SIGPENDING
fails:Process.getrlimit when passed a Symbol coerces :RTPRIO into RLIMIT_RTPRIO
fails:Process.getrlimit when passed a Symbol coerces :NICE into RLIMIT_NICE
fails:Process.getrlimit when passed a String coerces 'SBSIZE' into RLIMIT_SBSIZE
fails:Process.getrlimit when passed a String coerces 'RTTIME' into RLIMIT_RTTIME
fails:Process.getrlimit when passed a String coerces 'MSGQUEUE' into RLIMIT_MSGQUEUE
fails:Process.getrlimit when passed a String coerces 'SIGPENDING' into RLIMIT_SIGPENDING
fails:Process.getrlimit when passed a String coerces 'RTPRIO' into RLIMIT_RTPRIO
fails:Process.getrlimit when passed a String coerces 'NICE' into RLIMIT_NICE
27 changes: 27 additions & 0 deletions truffle/src/main/ruby/core/rubinius/common/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,37 @@

module Process
module Constants
EXIT_SUCCESS = Rubinius::Config['rbx.platform.process.EXIT_SUCCESS'] || 0
EXIT_FAILURE = Rubinius::Config['rbx.platform.process.EXIT_FAILURE'] || 1

PRIO_PGRP = Rubinius::Config['rbx.platform.process.PRIO_PGRP']
PRIO_PROCESS = Rubinius::Config['rbx.platform.process.PRIO_PROCESS']
PRIO_USER = Rubinius::Config['rbx.platform.process.PRIO_USER']

RLIM_INFINITY = Rubinius::Config['rbx.platform.process.RLIM_INFINITY']
RLIM_SAVED_MAX = Rubinius::Config['rbx.platform.process.RLIM_SAVED_MAX']
RLIM_SAVED_CUR = Rubinius::Config['rbx.platform.process.RLIM_SAVED_CUR']

RLIMIT_AS = Rubinius::Config['rbx.platform.process.RLIMIT_AS']
RLIMIT_CORE = Rubinius::Config['rbx.platform.process.RLIMIT_CORE']
RLIMIT_CPU = Rubinius::Config['rbx.platform.process.RLIMIT_CPU']
RLIMIT_DATA = Rubinius::Config['rbx.platform.process.RLIMIT_DATA']
RLIMIT_FSIZE = Rubinius::Config['rbx.platform.process.RLIMIT_FSIZE']
RLIMIT_MEMLOCK = Rubinius::Config['rbx.platform.process.RLIMIT_MEMLOCK']
RLIMIT_NOFILE = Rubinius::Config['rbx.platform.process.RLIMIT_NOFILE']
RLIMIT_NPROC = Rubinius::Config['rbx.platform.process.RLIMIT_NPROC']
RLIMIT_RSS = Rubinius::Config['rbx.platform.process.RLIMIT_RSS']
RLIMIT_SBSIZE = Rubinius::Config['rbx.platform.process.RLIMIT_SBSIZE']
RLIMIT_STACK = Rubinius::Config['rbx.platform.process.RLIMIT_STACK']

RLIMIT_RTPRIO = Rubinius::Config['rbx.platform.process.RLIMIT_RTPRIO']
RLIMIT_RTTIME = Rubinius::Config['rbx.platform.process.RLIMIT_RTTIME']
RLIMIT_SIGPENDING = Rubinius::Config['rbx.platform.process.RLIMIT_SIGPENDING']
RLIMIT_MSGQUEUE = Rubinius::Config['rbx.platform.process.RLIMIT_MSGQUEUE']
RLIMIT_NICE = Rubinius::Config['rbx.platform.process.RLIMIT_NICE']

WNOHANG = 1
WUNTRACED = 2
end
include Constants

Expand Down

0 comments on commit d5252c6

Please sign in to comment.