ruby-changes:19052
From: kosaki <ko1@a...>
Date: Fri, 11 Mar 2011 01:54:10 +0900 (JST)
Subject: [ruby-changes:19052] Ruby:r31090 (trunk): * process.c (proc_getmaxgroups, proc_setmaxgroups): Process#maxgroups
kosaki 2011-03-11 01:54:02 +0900 (Fri, 11 Mar 2011) New Revision: 31090 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31090 Log: * process.c (proc_getmaxgroups, proc_setmaxgroups): Process#maxgroups and Process#maxgroups= now raise NotImplementedError if the platform don't support supplementary groups concept. Modified files: trunk/ChangeLog trunk/NEWS trunk/process.c trunk/test/ruby/test_process.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 31089) +++ ChangeLog (revision 31090) @@ -1,3 +1,9 @@ +Fri Mar 11 01:40:35 2011 KOSAKI Motohiro <kosaki.motohiro@g...> + + * 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@g...> * process.c (get_sc_ngroups_max): return -1 if platform don't Index: process.c =================================================================== --- process.c (revision 31089) +++ process.c (revision 31090) @@ -4524,6 +4524,7 @@ #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 @@ return _maxgroups; } +#endif @@ -4719,7 +4721,7 @@ #define proc_initgroups rb_f_notimplement #endif - +#if defined(_SC_NGROUPS_MAX) || defined(NGROUPS_MAX) /* * call-seq: * Process.maxgroups -> fixnum @@ -4735,8 +4737,11 @@ { return INT2FIX(maxgroups()); } +#else +#define proc_getmaxgroups rb_f_notimplement +#endif - +#ifdef HAVE_SETGROUPS /* * call-seq: * Process.maxgroups= fixnum -> fixnum @@ -4764,6 +4769,9 @@ return INT2FIX(_maxgroups); } +#else +#define proc_setmaxgroups rb_f_notimplement +#endif #if defined(HAVE_DAEMON) || (defined(HAVE_FORK) && defined(HAVE_SETSID)) #ifndef HAVE_DAEMON Index: NEWS =================================================================== --- NEWS (revision 31089) +++ NEWS (revision 31090) @@ -80,6 +80,10 @@ * 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| } Index: test/ruby/test_process.rb =================================================================== --- test/ruby/test_process.rb (revision 31089) +++ test/ruby/test_process.rb (revision 31090) @@ -1158,6 +1158,7 @@ def test_maxgroups assert_kind_of(Integer, Process.maxgroups) + rescue NotImplementedError end def test_geteuid -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/