ruby-changes:72343
From: Nobuyoshi <ko1@a...>
Date: Tue, 28 Jun 2022 20:54:53 +0900 (JST)
Subject: [ruby-changes:72343] 5e66525e41 (master): [DOC] Document `Process::Tms`
https://git.ruby-lang.org/ruby.git/commit/?id=5e66525e41 From 5e66525e4156c27c625a529f1803d08d15e20fb7 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 28 Jun 2022 20:15:04 +0900 Subject: [DOC] Document `Process::Tms` --- process.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/process.c b/process.c index 53727ab116..57bfa808be 100644 --- a/process.c +++ b/process.c @@ -124,6 +124,12 @@ int initgroups(const char *, rb_gid_t); https://github.com/ruby/ruby/blob/trunk/process.c#L124 #endif #if defined(HAVE_TIMES) || defined(_WIN32) +/********************************************************************* + * + * Document-class: Process::Tms + * + * Placeholder for rusage + */ static VALUE rb_cProcessTms; #endif @@ -9124,8 +9130,17 @@ InitVM_process(void) https://github.com/ruby/ruby/blob/trunk/process.c#L9130 rb_define_module_function(rb_mProcess, "clock_getres", rb_clock_getres, -1); #if defined(HAVE_TIMES) || defined(_WIN32) - /* Placeholder for rusage */ rb_cProcessTms = rb_struct_define_under(rb_mProcess, "Tms", "utime", "stime", "cutime", "cstime", NULL); +#if 0 /* for RDoc */ + /* user time used in this process */ + rb_define_attr(rb_cProcessTms, "utime", TRUE, TRUE); + /* system time used in this process */ + rb_define_attr(rb_cProcessTms, "stime", TRUE, TRUE); + /* user time used in the child processes */ + rb_define_attr(rb_cProcessTms, "cutime", TRUE, TRUE); + /* system time used in the child processes */ + rb_define_attr(rb_cProcessTms, "cstime", TRUE, TRUE); +#endif #endif SAVED_USER_ID = geteuid(); -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/