setrlimit

Process.setrlimit(resource, cur_limit, max_limit) â nilProcess.setrlimit(resource, cur_limit) â nil Class Public methods Sets the resource limit of the process. cur_limit means current (soft) limit and max_limit means maximum (hard) limit. If max_limit is not given, cur_limit is used. resource indicates the kind of resource to limit. It should be a symbol such as :CORE, a string such as "CORE" or a constant such as Process::RLIMIT_CORE. The available resou

setsid

Process.setsid â fixnum Class Public methods Establishes this process as a new session and process group leader, with no controlling tty. Returns the session id. Not available on all platforms. Process.setsid #=> 27422

spawn

spawn([env,] command... [,options]) â pidProcess.spawn([env,] command... [,options]) â pid Class Public methods spawn executes specified command and return its pid. This method doesn't wait for end of the command. The parent process should use Process.wait to collect the termination status of its child or use Process.detach to register disinterest in their status; otherwise, the operating system may accumulate zombie processes. spawn has bunch of options to specify process

times

Process.times â aStructTms Class Public methods Returns a Tms structure (see Struct::Tms) that contains user and system CPU times for this process, and also for children processes. t = Process.times [ t.utime, t.stime, t.cutime, t.cstime ] #=> [0.0, 0.02, 0.00, 0.00]

uid

Process.uid â fixnumProcess::UID.rid â fixnumProcess::Sys.getuid â fixnum Class Public methods Returns the (real) user ID of this process. Process.uid #=> 501

uid=

Process.uid= user â numeric Class Public methods Sets the (user) user ID for this process. Not available on all platforms.

wait

Process.wait() â fixnumProcess.wait(pid=-1, flags=0) â fixnumProcess.waitpid(pid=-1, flags=0) â fixnum Class Public methods Waits for a child process to exit, returns its process id, and sets $? to a Process::Status object containing information on that process. Which child it waits on depends on the value of pid: > 0 Waits for the child whose process ID equals pid. 0 Waits for any child whose process group ID equals that of the calling process.

wait2

Process.wait2(pid=-1, flags=0) â [pid, status] Class Public methods Waits for a child process to exit (see ::waitpid for exact semantics) and returns an array containing the process id and the exit status (a Process::Status object) of that child. Raises a SystemCallError if there are no child processes. Process.fork { exit 99 } #=> 27437 pid, status = Process.wait2 pid #=> 27437 status.exitstatus #=> 99

waitall

Process.waitall â [ [pid1,status1], ...] Class Public methods Waits for all children, returning an array of pid/status pairs (where status is a Process::Status object). fork { sleep 0.2; exit 2 } #=> 27432 fork { sleep 0.1; exit 1 } #=> 27433 fork { exit 0 } #=> 27434 p Process.waitall produces: [[30982, #<Process::Status: pid 30982 exit 0>], [30979, #<Process::Status: pid 30979 exit 1>], [30976, #<Process::Status: pid 30976 exit 2>

waitpid

Process.waitpid(pid=-1, flags=0) â fixnum Class Public methods Waits for a child process to exit, returns its process id, and sets $? to a Process::Status object containing information on that process. Which child it waits on depends on the value of pid: > 0 Waits for the child whose process ID equals pid. 0 Waits for any child whose process group ID equals that of the calling process. -1 Waits for any child process (the default if no pid is given). < -1 Waits fo