* process.c (proc_getmaxgroups, proc_setmaxgroups): Process#maxgroups

and Process#maxgroups= now raise NotImplementedError if the
  platform don't support supplementary groups concept.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2011-03-10 16:54:02 +00:00
Родитель 2ff3ec5dbe
Коммит bd90dc80f2
4 изменённых файлов: 21 добавлений и 2 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Fri Mar 11 01:40:35 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* process.c (proc_getmaxgroups, proc_setmaxgroups): Process#maxgroups
and Process#maxgroups= now raise NotImplementedError if the
platform don't support supplementary groups concept.
Fri Mar 11 01:25:03 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* process.c (get_sc_ngroups_max): return -1 if platform don't

4
NEWS
Просмотреть файл

@ -80,6 +80,10 @@ with all sufficient information, see the ChangeLog file.
* extended method:
* Time#strftime supports %:z and %::z.
* Process
* Process#maxgroups and Process#maxgroups= now raise NotImplementedError if
the platform don't support supplementary groups concept.
* io/console
* new methods:
* IO#noecho {|io| }

Просмотреть файл

@ -4524,6 +4524,7 @@ proc_setgid(VALUE obj, VALUE id)
#endif
#if defined(HAVE_SETGROUPS) || defined(HAVE_GETGROUPS)
/*
* Maximum supplementary groups are platform dependent.
* FWIW, 65536 is enough big for our supported OSs.
@ -4566,6 +4567,7 @@ static int maxgroups(void)
return _maxgroups;
}
#endif
@ -4719,7 +4721,7 @@ proc_initgroups(VALUE obj, VALUE uname, VALUE base_grp)
#define proc_initgroups rb_f_notimplement
#endif
#if defined(_SC_NGROUPS_MAX) || defined(NGROUPS_MAX)
/*
* call-seq:
* Process.maxgroups -> fixnum
@ -4735,8 +4737,11 @@ proc_getmaxgroups(VALUE obj)
{
return INT2FIX(maxgroups());
}
#else
#define proc_getmaxgroups rb_f_notimplement
#endif
#ifdef HAVE_SETGROUPS
/*
* call-seq:
* Process.maxgroups= fixnum -> fixnum
@ -4764,6 +4769,9 @@ proc_setmaxgroups(VALUE obj, VALUE val)
return INT2FIX(_maxgroups);
}
#else
#define proc_setmaxgroups rb_f_notimplement
#endif
#if defined(HAVE_DAEMON) || (defined(HAVE_FORK) && defined(HAVE_SETSID))
#ifndef HAVE_DAEMON

Просмотреть файл

@ -1158,6 +1158,7 @@ class TestProcess < Test::Unit::TestCase
def test_maxgroups
assert_kind_of(Integer, Process.maxgroups)
rescue NotImplementedError
end
def test_geteuid