summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-10 05:18:03 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-10 05:18:03 +0000
commitc0d1a46fc3549340ccd4af8fbd0b491de4ea421d (patch)
treea4504d184815066ee4d6580b85c9249071276191 /process.c
parent6c70fede0c1fce37f7586d959b853df2bdbfff5f (diff)
process.c: fix rubyspec of Process.groups
getgroups(2) may return a GID list that includes duplicated GIDs. The behavior is totaly depends on what OS is used. This commit fixes the example of Process.groups so that the example is independent of this OS-dependent features. Additonaly, this commit adds the description of such system-dependent characteristics of Process.groups. [ruby-dev:50603] [Bug #14969] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/process.c b/process.c
index be583be6e3..ba800b9058 100644
--- a/process.c
+++ b/process.c
@@ -6136,6 +6136,19 @@ maxgroups(void)
*
* Process.groups #=> [27, 6, 10, 11]
*
+ * Note that this method is just a wrapper of getgroups(2).
+ * This means that the following characteristics of
+ * the results are completely depends on your system:
+ *
+ * - the result is sorted
+ * - the result includes effective GIDs
+ * - the result does not include duplicated GIDs
+ *
+ * You can certainly get a sorted unique GID list of
+ * the current process by this expression:
+ *
+ * Process.groups.unique.sort
+ *
*/
static VALUE