Sets limits for the current process for the given resource
to cur_limit
(soft limit) and max_limit
(hard limit); returns nil
.
Argument resource
specifies the resource whose limits are to be set; the argument may be given as a symbol, as a string, or as a constant beginning with Process::RLIMIT_
(e.g., :CORE
, 'CORE'
, or Process::RLIMIT_CORE
.
The resources available and supported are system-dependent, and may include (here expressed as symbols):
:AS
: Total available memory (bytes) (SUSv3, NetBSD, FreeBSD, OpenBSD except 4.4BSD-Lite).
:CORE
: Core size (bytes) (SUSv3).
:CPU
: CPU time (seconds) (SUSv3).
:DATA
: Data
segment (bytes) (SUSv3).
:FSIZE
: File
size (bytes) (SUSv3).
:MEMLOCK
: Total size for mlock(2) (bytes) (4.4BSD, GNU/Linux).
:MSGQUEUE
: Allocation for POSIX message queues (bytes) (GNU/Linux).
:NICE
: Ceiling on process’s nice(2) value (number) (GNU/Linux).
:NOFILE
: File
descriptors (number) (SUSv3).
:NPROC
: Number of processes for the user (number) (4.4BSD, GNU/Linux).
:NPTS
: Number of pseudo terminals (number) (FreeBSD).
:RSS
: Resident memory size (bytes) (4.2BSD, GNU/Linux).
:RTPRIO
: Ceiling on the process’s real-time priority (number) (GNU/Linux).
:RTTIME
: CPU time for real-time process (us) (GNU/Linux).
:SBSIZE
: All socket buffers (bytes) (NetBSD, FreeBSD).
:SIGPENDING
: Number of queued signals allowed (signals) (GNU/Linux).
:STACK
: Stack size (bytes) (SUSv3).
Arguments cur_limit
and max_limit
may be:
Integers (max_limit
should not be smaller than cur_limit
).
Symbol
:SAVED_MAX
, string 'SAVED_MAX'
, or constant Process::RLIM_SAVED_MAX
: saved maximum limit.
Symbol
:SAVED_CUR
, string 'SAVED_CUR'
, or constant Process::RLIM_SAVED_CUR
: saved current limit.
Symbol
:INFINITY
, string 'INFINITY'
, or constant Process::RLIM_INFINITY
: no limit on resource.
This example raises the soft limit of core size to the hard limit to try to make core dump possible:
Process.setrlimit(:CORE, Process.getrlimit(:CORE)[1])
Not available on all platforms.
Sets the supplemental group access list; the new list includes:
The group IDs of those groups to which the user given by username
belongs.
The group ID gid
.
Example:
Process.groups # => [0, 1, 2, 3, 4, 6, 10, 11, 20, 26, 27] Process.initgroups('me', 30) # => [30, 6, 10, 11] Process.groups # => [30, 6, 10, 11]
Not available on all platforms.
Returns whether RDoc
defines its own install hooks through a RubyGems plugin. This and whatever is guarded by it can be removed once no supported Ruby
ships with RDoc
older than 6.9.0.
Return the best specification that contains the file matching path
amongst the specs that are not activated.
Search through all unresolved deps and sub-dependencies and return specs that contain the file matching path
.
Return the best specification in the record that contains the file matching path
amongst the specs that are not activated.
Enables use of shared session key material in accordance with RFC 5705.
A node that is missing from the syntax tree. This is only used in the case of a syntax error.
if /foo #{bar}/ then end
^^^^^^^^^^^^
This method is deprecated and should not be used. This is a no-op.
When *, **, &, or … are used as an argument in a method call, we check if they were allowed by the current context. To determine that we build this lookup table.
Like Enumerable#map
, but chains operation to be lazy-evaluated.
(1..Float::INFINITY).lazy.map {|i| i**2 } #=> #<Enumerator::Lazy: #<Enumerator::Lazy: 1..Infinity>:map> (1..Float::INFINITY).lazy.map {|i| i**2 }.first(3) #=> [1, 4, 9]
Rewinds the enumerator chain by calling the “rewind” method on each enumerable in reverse order. Each call is performed only if the enumerable responds to the method.
Returns a printable version of the enumerator chain.
Rewinds the product enumerator by calling the “rewind” method on each enumerable in reverse order. Each call is performed only if the enumerable responds to the method.
Returns a printable version of the product enumerator.
Returns the number that defines the first element of this arithmetic sequence.
Convert this arithmetic sequence to a printable form.