* 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
This commit is contained in:
parent
32bd3c5679
commit
31094808f9
@ -1,3 +1,8 @@
|
|||||||
|
Mon Jun 9 13:27:13 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
|
* process.c (proc_getgroups, proc_setgroups): raise
|
||||||
|
NotImplementedError unless available. [ruby-talk:73014]
|
||||||
|
|
||||||
Sun Jun 8 13:37:21 2003 Takaaki Uematsu <uema2x@jcom.home.ne.jp>
|
Sun Jun 8 13:37:21 2003 Takaaki Uematsu <uema2x@jcom.home.ne.jp>
|
||||||
|
|
||||||
* wince/setup.mak: set SUBSYSTEM in each platform.
|
* wince/setup.mak: set SUBSYSTEM in each platform.
|
||||||
|
12
process.c
12
process.c
@ -45,7 +45,9 @@ struct timeval rb_time_interval _((VALUE));
|
|||||||
#include <sys/times.h>
|
#include <sys/times.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_GETGROUPS
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_TIMES) || defined(_WIN32)
|
#if defined(HAVE_TIMES) || defined(_WIN32)
|
||||||
static VALUE S_Tms;
|
static VALUE S_Tms;
|
||||||
@ -1227,6 +1229,7 @@ static size_t maxgroups = 32;
|
|||||||
static VALUE
|
static VALUE
|
||||||
proc_getgroups(VALUE obj)
|
proc_getgroups(VALUE obj)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_GETGROUPS
|
||||||
VALUE ary;
|
VALUE ary;
|
||||||
size_t ngroups = 32;
|
size_t ngroups = 32;
|
||||||
gid_t *groups;
|
gid_t *groups;
|
||||||
@ -1243,11 +1246,16 @@ proc_getgroups(VALUE obj)
|
|||||||
rb_ary_push(ary, INT2NUM(groups[i]));
|
rb_ary_push(ary, INT2NUM(groups[i]));
|
||||||
|
|
||||||
return ary;
|
return ary;
|
||||||
|
#else
|
||||||
|
rb_notimplement();
|
||||||
|
return Qnil;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
proc_setgroups(VALUE obj, VALUE ary)
|
proc_setgroups(VALUE obj, VALUE ary)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_GETGROUPS
|
||||||
size_t ngroups;
|
size_t ngroups;
|
||||||
gid_t *groups;
|
gid_t *groups;
|
||||||
int i;
|
int i;
|
||||||
@ -1284,6 +1292,10 @@ proc_setgroups(VALUE obj, VALUE ary)
|
|||||||
rb_sys_fail(0);
|
rb_sys_fail(0);
|
||||||
|
|
||||||
return proc_getgroups(obj);
|
return proc_getgroups(obj);
|
||||||
|
#else
|
||||||
|
rb_notimplement();
|
||||||
|
return Qnil;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user