[DOC] RDoc for Process (#8282)
This commit is contained in:
parent
ebb9034710
commit
f9aea75747
Notes:
git
2023-08-24 21:42:04 +00:00
Merged-By: peterzhu2118 <peter@peterzhu.ca>
91
process.c
91
process.c
@ -4345,13 +4345,18 @@ exit_status_code(VALUE status)
|
|||||||
NORETURN(static VALUE rb_f_exit_bang(int argc, VALUE *argv, VALUE obj));
|
NORETURN(static VALUE rb_f_exit_bang(int argc, VALUE *argv, VALUE obj));
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* Process.exit!(status=false)
|
* exit!(status = false)
|
||||||
|
* Process.exit!(status = false)
|
||||||
*
|
*
|
||||||
* Exits the process immediately. No exit handlers are
|
* Exits the process immediately; no exit handlers are called.
|
||||||
* run. <em>status</em> is returned to the underlying system as the
|
* Returns exit status +status+ to the underlying operating system.
|
||||||
* exit status.
|
|
||||||
*
|
*
|
||||||
* Process.exit!(true)
|
* Process.exit!(true)
|
||||||
|
*
|
||||||
|
* Values +true+ and +false+ for argument +status+
|
||||||
|
* indicate, respectively, success and failure;
|
||||||
|
* The meanings of integer values are system-dependent.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
@ -4402,43 +4407,47 @@ rb_f_exit(int argc, const VALUE *argv)
|
|||||||
NORETURN(static VALUE f_exit(int c, const VALUE *a, VALUE _));
|
NORETURN(static VALUE f_exit(int c, const VALUE *a, VALUE _));
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* exit(status=true)
|
* exit(status = true)
|
||||||
* Kernel::exit(status=true)
|
* Process.exit(status = true)
|
||||||
* Process::exit(status=true)
|
|
||||||
*
|
*
|
||||||
* Initiates the termination of the Ruby script by raising the
|
* Initiates termination of the Ruby script by raising SystemExit;
|
||||||
* SystemExit exception. This exception may be caught. The
|
* the exception may be caught.
|
||||||
* optional parameter is used to return a status code to the invoking
|
* Returns exit status +status+ to the underlying operating system.
|
||||||
* environment.
|
|
||||||
* +true+ and +FALSE+ of _status_ means success and failure
|
|
||||||
* respectively. The interpretation of other integer values are
|
|
||||||
* system dependent.
|
|
||||||
*
|
*
|
||||||
* begin
|
* Values +true+ and +false+ for argument +status+
|
||||||
* exit
|
* indicate, respectively, success and failure;
|
||||||
* puts "never get here"
|
* The meanings of integer values are system-dependent.
|
||||||
* rescue SystemExit
|
|
||||||
* puts "rescued a SystemExit exception"
|
|
||||||
* end
|
|
||||||
* puts "after begin block"
|
|
||||||
*
|
*
|
||||||
* <em>produces:</em>
|
* Example:
|
||||||
*
|
*
|
||||||
* rescued a SystemExit exception
|
* begin
|
||||||
* after begin block
|
* exit
|
||||||
|
* puts 'Never get here.'
|
||||||
|
* rescue SystemExit
|
||||||
|
* puts 'Rescued a SystemExit exception.'
|
||||||
|
* end
|
||||||
|
* puts 'After begin block.'
|
||||||
*
|
*
|
||||||
* Just prior to termination, Ruby executes any <code>at_exit</code>
|
* Output:
|
||||||
* functions (see Kernel::at_exit) and runs any object finalizers
|
|
||||||
* (see ObjectSpace::define_finalizer).
|
|
||||||
*
|
*
|
||||||
* at_exit { puts "at_exit function" }
|
* Rescued a SystemExit exception.
|
||||||
* ObjectSpace.define_finalizer("string", proc { puts "in finalizer" })
|
* After begin block.
|
||||||
* exit
|
|
||||||
*
|
*
|
||||||
* <em>produces:</em>
|
* Just prior to final termination,
|
||||||
|
* Ruby executes any at-exit procedures (see Kernel::at_exit)
|
||||||
|
* and any object finalizers (see ObjectSpace::define_finalizer).
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
*
|
||||||
|
* at_exit { puts 'In at_exit function.' }
|
||||||
|
* ObjectSpace.define_finalizer('string', proc { puts 'In finalizer.' })
|
||||||
|
* exit
|
||||||
|
*
|
||||||
|
* Output:
|
||||||
|
*
|
||||||
|
* In at_exit function.
|
||||||
|
* In finalizer.
|
||||||
*
|
*
|
||||||
* at_exit function
|
|
||||||
* in finalizer
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
@ -4477,14 +4486,16 @@ NORETURN(static VALUE f_abort(int c, const VALUE *a, VALUE _));
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* abort
|
* abort
|
||||||
* Kernel::abort([msg])
|
* Process.abort(msg = nil)
|
||||||
* Process.abort([msg])
|
|
||||||
*
|
*
|
||||||
* Terminate execution immediately, effectively by calling
|
* Terminates execution immediately, effectively by calling
|
||||||
* <code>Kernel.exit(false)</code>. If _msg_ is given, it is written
|
* <tt>Kernel.exit(false)</tt>.
|
||||||
* to STDERR prior to terminating. Otherwise, if an exception was raised,
|
*
|
||||||
* print its message and backtrace.
|
* If string argument +msg+ is given,
|
||||||
|
* it is written to STDERR prior to termination;
|
||||||
|
* otherwise, if an exception was raised,
|
||||||
|
* prints its message and backtrace.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user