summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-06-28 20:15:04 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-06-28 20:19:05 +0900
commit5e66525e4156c27c625a529f1803d08d15e20fb7 (patch)
treef061a780b3ae00386b28e64a9655e114e86ac184 /process.c
parent131422ceea4e1970e68907c337976b898a797d8a (diff)
downloadruby-5e66525e4156c27c625a529f1803d08d15e20fb7.tar.gz
[DOC] Document `Process::Tms`
Diffstat (limited to 'process.c')
-rw-r--r--process.c17
1 files changed, 16 insertions, 1 deletions
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);
#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)
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();