From de0ef1a9dfd9f966ad7e667788f3e333944d959e Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 28 Mar 2019 03:33:35 +0000 Subject: [DOC] fix markups [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- process.c | 134 ++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 65 insertions(+), 69 deletions(-) (limited to 'process.c') 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 * - * Process::Status encapsulates the information on the + * Process::Status encapsulates the information on the * status of a running or terminated system process. The built-in * variable $? is either +nil+ or a - * Process::Status 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 - * Process::Status 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 Integer. 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 wait call had the - * WUNTRACED 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 exited? 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 exited? 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 $? to a Process::Status object + * sets $? 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 - * Process::WNOHANG (do not block if no child available) - * or Process::WUNTRACED (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 Process::Status 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 - * Process::Status 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 wait()). If the parent never collects * this status, the child stays around as a zombie process. - * 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. + * 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 Thread#join 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 pid 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, Process::detach 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 Errno::ENOENT 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 - * Kernel.exit! to avoid running any - * at_exit 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. + * 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 at_exit + * 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 - * SystemExit 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 at_exit functions - * (see Kernel::at_exit) and runs any object finalizers (see - * ObjectSpace::define_finalizer). + * Just prior to termination, Ruby executes any at_exit + * 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 - * exec and spawn. + * 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 Process.wait to collect + * use Process.wait to collect * the termination status of its child or - * use Process.detach 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 spawn. + * 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 spawn. + * 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 Kernel.exec 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 Thread#run. 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. kind indicates the kind of entity to find: one - * of Process::PRIO_PGRP, - * Process::PRIO_USER, or - * Process::PRIO_PROCESS. _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 Process#getpriority. + * 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 :CORE, * a string such as "CORE" or - * a constant such as Process::RLIMIT_CORE. + * a constant such as Process::RLIMIT_CORE. * See Process.setrlimit for details. * - * _cur_limit_ and _max_limit_ may be Process::RLIM_INFINITY, - * Process::RLIM_SAVED_MAX or - * Process::RLIM_SAVED_CUR. + * _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 :CORE, * a string such as "CORE" or - * a constant such as Process::RLIMIT_CORE. + * 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 * :INFINITY, "INFINITY" or - * Process::RLIM_INFINITY, + * Process::RLIM_INFINITY, * which means that the resource is not limited. - * They may be Process::RLIM_SAVED_MAX, - * Process::RLIM_SAVED_CUR 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 Process::Sys 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 Process, - * Process::UID, and Process::GID 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 Process::UID 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 Array 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 - * Array 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 gid is also - * added to the list. Returns the resulting Array 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 Process::GID 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 Tms structure (see Process::Tms) + * Returns a Tms 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 Process module is a collection of methods used to + * The Process module is a collection of methods used to * manipulate processes. */ -- cgit v1.2.3