Skip to content

Commit 3602e25

Browse files
BurdetteLamarpeterzhu2118
authored andcommitted
[DOC] RDoc for process.c
1 parent f867e93 commit 3602e25

File tree

1 file changed

+43
-32
lines changed

1 file changed

+43
-32
lines changed

process.c

Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6931,15 +6931,22 @@ static int rb_daemon(int nochdir, int noclose);
69316931

69326932
/*
69336933
* call-seq:
6934-
* Process.daemon() -> 0
6935-
* Process.daemon(nochdir=nil,noclose=nil) -> 0
6936-
*
6937-
* Detach the process from controlling terminal and run in the
6938-
* background as system daemon. Unless the argument _nochdir_ is
6939-
* +true+, it changes the current working directory to the root
6940-
* ("/"). Unless the argument _noclose_ is +true+, daemon() will
6941-
* redirect standard input, standard output and standard error to
6942-
* null device. Return zero on success, or raise one of Errno::*.
6934+
* Process.daemon(nochdir = nil, noclose = nil) -> 0
6935+
*
6936+
* Detaches the current process from its controlling terminal
6937+
* and runs it in the background as system daemon;
6938+
* returns zero.
6939+
*
6940+
* By default:
6941+
*
6942+
* - Changes the current working directory to the root directory.
6943+
* - Redirects $stdin, $stdout, and $stderr to the null device.
6944+
*
6945+
* If optional argument +nochdir+ is +true+,
6946+
* does not change the current working directory.
6947+
*
6948+
* If optional argument +noclose+ is +true+,
6949+
* does not redirect $stdin, $stdout, or $stderr.
69436950
*/
69446951

69456952
static VALUE
@@ -7196,13 +7203,14 @@ p_gid_change_privilege(VALUE obj, VALUE id)
71967203

71977204
/*
71987205
* call-seq:
7199-
* Process.euid -> integer
7200-
* Process::UID.eid -> integer
7201-
* Process::Sys.geteuid -> integer
7206+
* Process.euid -> integer
7207+
* Process::UID.eid -> integer
7208+
* Process::Sys.geteuid -> integer
7209+
*
7210+
* Returns the effective user ID for the current process.
72027211
*
7203-
* Returns the effective user ID for this process.
7212+
* Process.euid # => 501
72047213
*
7205-
* Process.euid #=> 501
72067214
*/
72077215

72087216
static VALUE
@@ -7238,10 +7246,11 @@ proc_seteuid(rb_uid_t uid)
72387246
#if defined(HAVE_SETRESUID) || defined(HAVE_SETREUID) || defined(HAVE_SETEUID) || defined(HAVE_SETUID)
72397247
/*
72407248
* call-seq:
7241-
* Process.euid= user
7249+
* Process.euid = new_euid -> new_euid
7250+
*
7251+
* Sets the effective user ID for the current process.
72427252
*
7243-
* Sets the effective user ID for this process. Not available on all
7244-
* platforms.
7253+
* Not available on all platforms.
72457254
*/
72467255

72477256
static VALUE
@@ -7319,14 +7328,15 @@ p_uid_grant_privilege(VALUE obj, VALUE id)
73197328

73207329
/*
73217330
* call-seq:
7322-
* Process.egid -> integer
7323-
* Process::GID.eid -> integer
7324-
* Process::Sys.geteid -> integer
7331+
* Process.egid -> integer
7332+
* Process::GID.eid -> integer
7333+
* Process::Sys.geteid -> integer
7334+
*
7335+
* Returns the effective group ID for the current process:
73257336
*
7326-
* Returns the effective group ID for this process. Not available on
7327-
* all platforms.
7337+
* Process.egid # => 500
73287338
*
7329-
* Process.egid #=> 500
7339+
* Not available on all platforms.
73307340
*/
73317341

73327342
static VALUE
@@ -7340,10 +7350,11 @@ proc_getegid(VALUE obj)
73407350
#if defined(HAVE_SETRESGID) || defined(HAVE_SETREGID) || defined(HAVE_SETEGID) || defined(HAVE_SETGID) || defined(_POSIX_SAVED_IDS)
73417351
/*
73427352
* call-seq:
7343-
* Process.egid = integer -> integer
7353+
* Process.egid = new_egid -> new_egid
73447354
*
7345-
* Sets the effective group ID for this process. Not available on all
7346-
* platforms.
7355+
* Sets the effective group ID for the current process.
7356+
*
7357+
* Not available on all platforms.
73477358
*/
73487359

73497360
static VALUE
@@ -7816,14 +7827,14 @@ get_clk_tck(void)
78167827

78177828
/*
78187829
* call-seq:
7819-
* Process.times -> aProcessTms
7830+
* Process.times -> process_tms
7831+
*
7832+
* Returns a Process::Tms structure that contains user and system CPU times
7833+
* for the current process, and for its children processes:
78207834
*
7821-
* Returns a <code>Tms</code> structure (see Process::Tms)
7822-
* that contains user and system CPU times for this process,
7823-
* and also for children processes.
7835+
* Process.times
7836+
* # => #<struct Process::Tms utime=55.122118, stime=35.533068, cutime=0.0, cstime=0.002846>
78247837
*
7825-
* t = Process.times
7826-
* [ t.utime, t.stime, t.cutime, t.cstime ] #=> [0.0, 0.02, 0.00, 0.00]
78277838
*/
78287839

78297840
VALUE

0 commit comments

Comments
 (0)