summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-28 03:33:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-28 03:33:35 +0000
commitde0ef1a9dfd9f966ad7e667788f3e333944d959e (patch)
tree53bbb3c3560a6f548021486afbf423e740740774 /process.c
parent832bc50768fe42f95f8dda0483f0ba1556175c9d (diff)
[DOC] fix markups [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c134
1 files changed, 65 insertions, 69 deletions
diff --git a/process.c b/process.c
index b02fa59e42..87780f74bd 100644
--- a/process.c
+++ b/process.c
@@ -463,10 +463,10 @@ get_ppid(void)
*
* Document-class: Process::Status
*
- * <code>Process::Status</code> encapsulates the information on the
+ * Process::Status encapsulates the information on the
* status of a running or terminated system process. The built-in
* variable <code>$?</code> is either +nil+ or a
- * <code>Process::Status</code> object.
+ * Process::Status object.
*
* fork { exit 99 } #=> 26557
* Process.wait #=> 26557
@@ -483,7 +483,7 @@ get_ppid(void)
* information (for example the program's return code in the case of
* exited processes). Pre Ruby 1.8, these bits were exposed directly
* to the Ruby program. Ruby now encapsulates these in a
- * <code>Process::Status</code> object. To maximize compatibility,
+ * Process::Status object. To maximize compatibility,
* however, these objects retain a bit-oriented interface. In the
* descriptions that follow, when we talk about the integer value of
* _stat_, we're referring to this 16 bit value.
@@ -538,7 +538,7 @@ rb_last_status_clear(void)
* stat.to_i -> integer
* stat.to_int -> integer
*
- * Returns the bits in _stat_ as a <code>Integer</code>. Poking
+ * Returns the bits in _stat_ as a Integer. Poking
* around in these bits is platform dependent.
*
* fork { exit 0xab } #=> 26566
@@ -736,9 +736,9 @@ pst_rshift(VALUE st1, VALUE st2)
* call-seq:
* stat.stopped? -> true or false
*
- * Returns +true+ if this process is stopped. This is only
- * returned if the corresponding <code>wait</code> call had the
- * <code>WUNTRACED</code> flag set.
+ * Returns +true+ if this process is stopped. This is only returned
+ * if the corresponding #wait call had the Process::WUNTRACED flag
+ * set.
*/
static VALUE
@@ -838,8 +838,7 @@ pst_wifexited(VALUE st)
* stat.exitstatus -> integer or nil
*
* Returns the least significant eight bits of the return code of
- * _stat_. Only available if <code>exited?</code> is
- * +true+.
+ * _stat_. Only available if #exited? is +true+.
*
* fork { } #=> 26572
* Process.wait #=> 26572
@@ -868,7 +867,7 @@ pst_wexitstatus(VALUE st)
* stat.success? -> true, false or nil
*
* Returns +true+ if _stat_ is successful, +false+ if not.
- * Returns +nil+ if <code>exited?</code> is not +true+.
+ * Returns +nil+ if #exited? is not +true+.
*/
static VALUE
@@ -1241,7 +1240,7 @@ rb_waitpid(rb_pid_t pid, int *st, int flags)
* Process.waitpid(pid=-1, flags=0) -> integer
*
* Waits for a child process to exit, returns its process id, and
- * sets <code>$?</code> to a <code>Process::Status</code> object
+ * sets <code>$?</code> to a Process::Status object
* containing information on that process. Which child it waits on
* depends on the value of _pid_:
*
@@ -1257,8 +1256,8 @@ rb_waitpid(rb_pid_t pid, int *st, int flags)
* value of _pid_.
*
* The _flags_ argument may be a logical or of the flag values
- * <code>Process::WNOHANG</code> (do not block if no child available)
- * or <code>Process::WUNTRACED</code> (return stopped children that
+ * Process::WNOHANG (do not block if no child available)
+ * or Process::WUNTRACED (return stopped children that
* haven't been reported). Not all flags are available on all
* platforms, but a flag value of zero will work on all platforms.
*
@@ -1312,7 +1311,7 @@ proc_wait(int argc, VALUE *argv)
*
* Waits for a child process to exit (see Process::waitpid for exact
* semantics) and returns an array containing the process id and the
- * exit status (a <code>Process::Status</code> object) of that
+ * exit status (a Process::Status object) of that
* child. Raises a SystemCallError if there are no child processes.
*
* Process.fork { exit 99 } #=> 27437
@@ -1336,7 +1335,7 @@ proc_wait2(int argc, VALUE *argv)
*
* Waits for all children, returning an array of
* _pid_/_status_ pairs (where _status_ is a
- * <code>Process::Status</code> object).
+ * Process::Status object).
*
* fork { sleep 0.2; exit 2 } #=> 27432
* fork { sleep 0.1; exit 1 } #=> 27433
@@ -1411,18 +1410,17 @@ rb_detach_process(rb_pid_t pid)
* processes until the parent collects that status (normally using
* some variant of <code>wait()</code>). If the parent never collects
* this status, the child stays around as a <em>zombie</em> process.
- * <code>Process::detach</code> prevents this by setting up a
- * separate Ruby thread whose sole job is to reap the status of the
- * process _pid_ when it terminates. Use <code>detach</code>
- * only when you do not intend to explicitly wait for the child to
- * terminate.
+ * Process::detach prevents this by setting up a separate Ruby thread
+ * whose sole job is to reap the status of the process _pid_ when it
+ * terminates. Use #detach only when you do not intend to explicitly
+ * wait for the child to terminate.
*
* The waiting thread returns the exit status of the detached process
- * when it terminates, so you can use <code>Thread#join</code> to
+ * when it terminates, so you can use Thread#join to
* know the result. If specified _pid_ is not a valid child process
* ID, the thread returns +nil+ immediately.
*
- * The waiting thread has <code>pid</code> method which returns the pid.
+ * The waiting thread has #pid method which returns the pid.
*
* In this first example, we don't reap the first child process, so
* it appears as a zombie in the process status display.
@@ -1437,7 +1435,7 @@ rb_detach_process(rb_pid_t pid)
*
* 27389 Z
*
- * In the next example, <code>Process::detach</code> is used to reap
+ * In the next example, Process::detach is used to reap
* the child automatically.
*
* p1 = fork { sleep 0.1 }
@@ -2914,7 +2912,7 @@ rb_execarg_fail(VALUE execarg_obj, int err, const char *errmsg)
* This behavior is modified by the given +env+ and +options+ parameters. See
* ::spawn for details.
*
- * If the command fails to execute (typically <code>Errno::ENOENT</code> when
+ * If the command fails to execute (typically Errno::ENOENT when
* it was not found) a SystemCallError exception is raised.
*
* This method modifies process attributes according to given +options+ before
@@ -4072,15 +4070,14 @@ COMPILER_WARNING_POP
*
* Creates a subprocess. If a block is specified, that block is run
* in the subprocess, and the subprocess terminates with a status of
- * zero. Otherwise, the +fork+ call returns twice, once in
- * the parent, returning the process ID of the child, and once in
- * the child, returning _nil_. The child process can exit using
- * <code>Kernel.exit!</code> to avoid running any
- * <code>at_exit</code> functions. The parent process should
- * use <code>Process.wait</code> to collect the termination statuses
- * of its children or use <code>Process.detach</code> to register
- * disinterest in their status; otherwise, the operating system
- * may accumulate zombie processes.
+ * zero. Otherwise, the +fork+ call returns twice, once in the
+ * parent, returning the process ID of the child, and once in the
+ * child, returning _nil_. The child process can exit using
+ * Kernel.exit! to avoid running any <code>at_exit</code>
+ * functions. The parent process should use Process.wait to collect
+ * the termination statuses of its children or use Process.detach to
+ * register disinterest in their status; otherwise, the operating
+ * system may accumulate zombie processes.
*
* The thread calling fork is the only thread in the created child process.
* fork doesn't copy other threads.
@@ -4189,7 +4186,7 @@ rb_exit(int status)
* Process::exit(status=true)
*
* Initiates the termination of the Ruby script by raising the
- * <code>SystemExit</code> exception. This exception may be caught. 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
@@ -4209,9 +4206,9 @@ rb_exit(int status)
* rescued a SystemExit exception
* after begin block
*
- * 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).
+ * 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).
*
* at_exit { puts "at_exit function" }
* ObjectSpace.define_finalizer("string", proc { puts "in finalizer" })
@@ -4440,8 +4437,7 @@ rb_spawn(int argc, const VALUE *argv)
* The arguments are processed in the same way as
* for Kernel#spawn.
*
- * The hash arguments, env and options, are same as
- * <code>exec</code> and <code>spawn</code>.
+ * The hash arguments, env and options, are same as #exec and #spawn.
* See Kernel#spawn for details.
*
* system("echo *")
@@ -4542,9 +4538,9 @@ rb_f_system(int argc, VALUE *argv)
* to finish.
*
* The parent process should
- * use <code>Process.wait</code> to collect
+ * use Process.wait to collect
* the termination status of its child or
- * use <code>Process.detach</code> to register
+ * use Process.detach to register
* disinterest in their status;
* otherwise, the operating system may accumulate zombie processes.
*
@@ -4674,12 +4670,12 @@ rb_f_system(int argc, VALUE *argv)
* pid = spawn(command, STDERR=>:out)
* pid = spawn(command, STDERR=>STDOUT)
*
- * The hash keys specifies a file descriptor
- * in the child process started by <code>spawn</code>.
+ * The hash keys specifies a file descriptor in the child process
+ * started by #spawn.
* :err, 2 and STDERR specifies the standard error stream (stderr).
*
- * The hash values specifies a file descriptor
- * in the parent process which invokes <code>spawn</code>.
+ * The hash values specifies a file descriptor in the parent process
+ * which invokes #spawn.
* :out, 1 and STDOUT specifies the standard output stream (stdout).
*
* In the above example,
@@ -4790,7 +4786,7 @@ rb_f_system(int argc, VALUE *argv)
* Internally, +spawn+ uses an extra file descriptor to resolve such cyclic
* file descriptor mapping.
*
- * See <code>Kernel.exec</code> for the standard shell.
+ * See Kernel.exec for the standard shell.
*/
static VALUE
@@ -4827,7 +4823,7 @@ rb_f_spawn(int argc, VALUE *argv)
* Suspends the current thread for _duration_ seconds (which may be any number,
* including a +Float+ with fractional seconds). Returns the actual number of
* seconds slept (rounded), which may be less than that asked for if another
- * thread calls <code>Thread#run</code>. Called without an argument, sleep()
+ * thread calls Thread#run. Called without an argument, sleep()
* will sleep forever.
*
* Time.new #=> 2008-03-08 19:56:19 +0900
@@ -5063,9 +5059,9 @@ ruby_setsid(void)
*
* Gets the scheduling priority for specified process, process group,
* or user. <em>kind</em> indicates the kind of entity to find: one
- * of <code>Process::PRIO_PGRP</code>,
- * <code>Process::PRIO_USER</code>, or
- * <code>Process::PRIO_PROCESS</code>. _integer_ is an id
+ * of Process::PRIO_PGRP,
+ * Process::PRIO_USER, or
+ * Process::PRIO_PROCESS. _integer_ is an id
* indicating the particular process, process group, or user (an id
* of 0 means _current_). Lower priorities are more favorable
* for scheduling. Not available on all platforms.
@@ -5097,7 +5093,7 @@ proc_getpriority(VALUE obj, VALUE which, VALUE who)
* call-seq:
* Process.setpriority(kind, integer, priority) -> 0
*
- * See <code>Process#getpriority</code>.
+ * See Process#getpriority.
*
* Process.setpriority(Process::PRIO_USER, 0, 19) #=> 0
* Process.setpriority(Process::PRIO_PROCESS, 0, 19) #=> 0
@@ -5356,12 +5352,12 @@ rlimit_resource_value(VALUE rval)
* _resource_ indicates the kind of resource to limit.
* It is specified as a symbol such as <code>:CORE</code>,
* a string such as <code>"CORE"</code> or
- * a constant such as <code>Process::RLIMIT_CORE</code>.
+ * a constant such as Process::RLIMIT_CORE.
* See Process.setrlimit for details.
*
- * _cur_limit_ and _max_limit_ may be <code>Process::RLIM_INFINITY</code>,
- * <code>Process::RLIM_SAVED_MAX</code> or
- * <code>Process::RLIM_SAVED_CUR</code>.
+ * _cur_limit_ and _max_limit_ may be Process::RLIM_INFINITY,
+ * Process::RLIM_SAVED_MAX or
+ * Process::RLIM_SAVED_CUR.
* See Process.setrlimit and the system getrlimit(2) manual for details.
*/
@@ -5394,7 +5390,7 @@ proc_getrlimit(VALUE obj, VALUE resource)
* _resource_ indicates the kind of resource to limit.
* It should be a symbol such as <code>:CORE</code>,
* a string such as <code>"CORE"</code> or
- * a constant such as <code>Process::RLIMIT_CORE</code>.
+ * a constant such as Process::RLIMIT_CORE.
* The available resources are OS dependent.
* Ruby may support following resources.
*
@@ -5417,10 +5413,10 @@ proc_getrlimit(VALUE obj, VALUE resource)
*
* _cur_limit_ and _max_limit_ may be
* <code>:INFINITY</code>, <code>"INFINITY"</code> or
- * <code>Process::RLIM_INFINITY</code>,
+ * Process::RLIM_INFINITY,
* which means that the resource is not limited.
- * They may be <code>Process::RLIM_SAVED_MAX</code>,
- * <code>Process::RLIM_SAVED_CUR</code> and
+ * They may be Process::RLIM_SAVED_MAX,
+ * Process::RLIM_SAVED_CUR and
* corresponding symbols and strings too.
* See system setrlimit(2) manual for details.
*
@@ -5477,11 +5473,11 @@ check_gid_switch(void)
/*********************************************************************
* Document-class: Process::Sys
*
- * The <code>Process::Sys</code> module contains UID and GID
+ * The Process::Sys module contains UID and GID
* functions which provide direct bindings to the system calls of the
* same names instead of the more-portable versions of the same
- * functionality found in the <code>Process</code>,
- * <code>Process::UID</code>, and <code>Process::GID</code> modules.
+ * functionality found in the Process,
+ * Process::UID, and Process::GID modules.
*/
#if defined(HAVE_PWD_H)
@@ -5828,7 +5824,7 @@ proc_setuid(VALUE obj, VALUE id)
*
* Document-class: Process::UID
*
- * The <code>Process::UID</code> module contains a collection of
+ * The Process::UID module contains a collection of
* module functions which can be used to portably get, set, and
* switch the current process's real, effective, and saved user IDs.
*
@@ -6283,7 +6279,7 @@ maxgroups(void)
* call-seq:
* Process.groups -> array
*
- * Get an <code>Array</code> of the group IDs in the
+ * Get an Array of the group IDs in the
* supplemental group access list for this process.
*
* Process.groups #=> [27, 6, 10, 11]
@@ -6339,7 +6335,7 @@ proc_getgroups(VALUE obj)
* Process.groups= array -> array
*
* Set the supplemental group access list to the given
- * <code>Array</code> of group IDs.
+ * Array of group IDs.
*
* Process.groups #=> [0, 1, 2, 3, 4, 6, 10, 11, 20, 26, 27]
* Process.groups = [27, 6, 10, 11] #=> [27, 6, 10, 11]
@@ -6390,7 +6386,7 @@ proc_setgroups(VALUE obj, VALUE ary)
* Initializes the supplemental group access list by reading the
* system group database and using all groups of which the given user
* is a member. The group with the specified <em>gid</em> is also
- * added to the list. Returns the resulting <code>Array</code> of the
+ * added to the list. Returns the resulting Array of the
* gids of all the groups in the supplementary group access list. Not
* available on all platforms.
*
@@ -6546,7 +6542,7 @@ rb_daemon(int nochdir, int noclose)
*
* Document-class: Process::GID
*
- * The <code>Process::GID</code> module contains a collection of
+ * The Process::GID module contains a collection of
* module functions which can be used to portably get, set, and
* switch the current process's real, effective, and saved group IDs.
*
@@ -7360,7 +7356,7 @@ get_clk_tck(void)
* call-seq:
* Process.times -> aProcessTms
*
- * Returns a <code>Tms</code> structure (see <code>Process::Tms</code>)
+ * Returns a <code>Tms</code> structure (see Process::Tms)
* that contains user and system CPU times for this process,
* and also for children processes.
*
@@ -8048,7 +8044,7 @@ static VALUE rb_mProcID_Syscall;
/*
- * The <code>Process</code> module is a collection of methods used to
+ * The Process module is a collection of methods used to
* manipulate processes.
*/