summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-09 04:27:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-09 04:27:17 +0000
commit31094808f99856180fb45e4fd5359621788b28f3 (patch)
tree62aee501a93eb4341a840e580bb812bde387fa59 /process.c
parent32bd3c5679d39b1679a25f0bdb1453858376dce0 (diff)
* process.c (proc_getgroups, proc_setgroups): raise
NotImplementedError unless available. [ruby-talk:73014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/process.c b/process.c
index 2ee27d1..0fffb6d 100644
--- a/process.c
+++ b/process.c
@@ -45,7 +45,9 @@ struct timeval rb_time_interval _((VALUE));
#include <sys/times.h>
#endif
+#ifdef HAVE_GETGROUPS
#include <grp.h>
+#endif
#if defined(HAVE_TIMES) || defined(_WIN32)
static VALUE S_Tms;
@@ -1227,6 +1229,7 @@ static size_t maxgroups = 32;
static VALUE
proc_getgroups(VALUE obj)
{
+#ifdef HAVE_GETGROUPS
VALUE ary;
size_t ngroups = 32;
gid_t *groups;
@@ -1243,11 +1246,16 @@ proc_getgroups(VALUE obj)
rb_ary_push(ary, INT2NUM(groups[i]));
return ary;
+#else
+ rb_notimplement();
+ return Qnil;
+#endif
}
static VALUE
proc_setgroups(VALUE obj, VALUE ary)
{
+#ifdef HAVE_GETGROUPS
size_t ngroups;
gid_t *groups;
int i;
@@ -1284,6 +1292,10 @@ proc_setgroups(VALUE obj, VALUE ary)
rb_sys_fail(0);
return proc_getgroups(obj);
+#else
+ rb_notimplement();
+ return Qnil;
+#endif
}
static VALUE