aboutsummaryrefslogtreecommitdiffstats
path: root/process.c
diff options
context:
space:
mode:
authorBurdette Lamar <BurdetteLamar@Yahoo.com>2023-08-24 16:41:43 -0500
committerGitHub <noreply@github.com>2023-08-24 17:41:43 -0400
commitf9aea75747c64af69eecee666a824827e77d9acf (patch)
tree050f7238a37ac2c577480649c4755f46b2db113b /process.c
parentebb9034710f2f0e9ce27b451daa1cd279232de5c (diff)
downloadruby-f9aea75747c64af69eecee666a824827e77d9acf.tar.gz
[DOC] RDoc for Process (#8282)
Diffstat (limited to 'process.c')
-rw-r--r--process.c97
1 files changed, 54 insertions, 43 deletions
diff --git a/process.c b/process.c
index 16a075c1d6..fa2ae7344a 100644
--- a/process.c
+++ b/process.c
@@ -4345,13 +4345,18 @@ exit_status_code(VALUE status)
NORETURN(static VALUE rb_f_exit_bang(int argc, VALUE *argv, VALUE obj));
/*
* call-seq:
- * Process.exit!(status=false)
+ * exit!(status = false)
+ * Process.exit!(status = false)
*
- * Exits the process immediately. No exit handlers are
- * run. <em>status</em> is returned to the underlying system as the
- * exit status.
+ * Exits the process immediately; no exit handlers are called.
+ * Returns exit status +status+ to the underlying operating system.
*
* 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
@@ -4402,43 +4407,47 @@ rb_f_exit(int argc, const VALUE *argv)
NORETURN(static VALUE f_exit(int c, const VALUE *a, VALUE _));
/*
* call-seq:
- * exit(status=true)
- * Kernel::exit(status=true)
- * Process::exit(status=true)
- *
- * Initiates the termination of the Ruby script by raising the
- * SystemExit exception. This exception may be caught. The
- * optional parameter is used to return a status code to the invoking
- * environment.
- * +true+ and +FALSE+ of _status_ means success and failure
- * respectively. The interpretation of other integer values are
- * system dependent.
- *
- * begin
- * exit
- * puts "never get here"
- * rescue SystemExit
- * puts "rescued a SystemExit exception"
- * end
- * puts "after begin block"
+ * exit(status = true)
+ * Process.exit(status = true)
*
- * <em>produces:</em>
+ * Initiates termination of the Ruby script by raising SystemExit;
+ * the exception may be caught.
+ * Returns exit status +status+ to the underlying operating system.
*
- * rescued a SystemExit exception
- * after begin block
+ * Values +true+ and +false+ for argument +status+
+ * indicate, respectively, success and failure;
+ * The meanings of integer values are system-dependent.
*
- * Just prior to termination, Ruby executes any <code>at_exit</code>
- * functions (see Kernel::at_exit) and runs any object finalizers
- * (see ObjectSpace::define_finalizer).
+ * Example:
*
- * at_exit { puts "at_exit function" }
- * ObjectSpace.define_finalizer("string", proc { puts "in finalizer" })
- * exit
+ * begin
+ * exit
+ * puts 'Never get here.'
+ * rescue SystemExit
+ * puts 'Rescued a SystemExit exception.'
+ * end
+ * puts 'After begin block.'
*
- * <em>produces:</em>
+ * Output:
+ *
+ * Rescued a SystemExit exception.
+ * After begin block.
+ *
+ * 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
@@ -4477,14 +4486,16 @@ NORETURN(static VALUE f_abort(int c, const VALUE *a, VALUE _));
/*
* call-seq:
- * abort
- * Kernel::abort([msg])
- * Process.abort([msg])
- *
- * Terminate execution immediately, effectively by calling
- * <code>Kernel.exit(false)</code>. If _msg_ is given, it is written
- * to STDERR prior to terminating. Otherwise, if an exception was raised,
- * print its message and backtrace.
+ * abort
+ * Process.abort(msg = nil)
+ *
+ * Terminates execution immediately, effectively by calling
+ * <tt>Kernel.exit(false)</tt>.
+ *
+ * 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