From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: prj@po.cwru.edu (Paul Jarc) Newsgroups: gmane.lisp.guile.devel Subject: Re: setgroups Date: Fri, 18 Apr 2003 13:49:53 -0400 Organization: What did you have in mind? A short, blunt, human pyramid? Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: References: <87brz4dagq.fsf@raven.i.defaultvalue.org> <87u1cwcwcq.fsf@raven.i.defaultvalue.org> <874r4w85b6.fsf@zagadka.ping.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1050688293 25305 80.91.224.249 (18 Apr 2003 17:51:33 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 18 Apr 2003 17:51:33 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Apr 18 19:51:31 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 196a17-0006ZM-00 for ; Fri, 18 Apr 2003 19:51:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 196a0z-00023b-02 for guile-devel@m.gmane.org; Fri, 18 Apr 2003 13:51:09 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 196a0X-0001ox-00 for guile-devel@gnu.org; Fri, 18 Apr 2003 13:50:41 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 196a09-0001WI-00 for guile-devel@gnu.org; Fri, 18 Apr 2003 13:50:18 -0400 Original-Received: from multivac.student.cwru.edu ([129.22.114.26] helo=multivac.cwru.edu) by monty-python.gnu.org with smtp (Exim 4.10.13) id 196Zzm-00011V-00 for guile-devel@gnu.org; Fri, 18 Apr 2003 13:49:54 -0400 Original-Received: (qmail 19653 invoked by uid 500); 18 Apr 2003 17:50:16 -0000 Original-To: guile-devel@gnu.org In-Reply-To: (Paul Jarc's message of "Fri, 18 Apr 2003 13:38:46 -0400") Mail-Copies-To: nobody Mail-Followup-To: guile-devel@gnu.org Original-Lines: 71 User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2189 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2189 Grr. I was comparing an unsigned value >= 0. Ok, *this* should be right. Index: configure.in =================================================================== RCS file: /cvsroot/guile/guile/guile-core/configure.in,v retrieving revision 1.213 diff -u -r1.213 configure.in --- configure.in 7 Apr 2003 17:31:02 -0000 1.213 +++ configure.in 18 Apr 2003 17:48:43 -0000 @@ -583,7 +583,7 @@ [Define if the system supports Unix-domain (file-domain) sockets.]) fi -AC_CHECK_FUNCS(socketpair getgroups setpwent pause tzset) +AC_CHECK_FUNCS(socketpair getgroups setgroups setpwent pause tzset) AC_CHECK_FUNCS(sethostent gethostent endhostent dnl setnetent getnetent endnetent dnl Index: libguile/posix.c =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/posix.c,v retrieving revision 1.112 diff -u -r1.112 posix.c --- libguile/posix.c 5 Apr 2003 19:10:22 -0000 1.112 +++ libguile/posix.c 18 Apr 2003 17:48:44 -0000 @@ -228,6 +228,41 @@ #undef FUNC_NAME #endif +#ifdef HAVE_SETGROUPS +SCM_DEFINE (scm_setgroups, "setgroups", 1, 0, 0, + (SCM group_vec), + "Set the supplementary group IDs to those found in the vector\n" + "argument.") +#define FUNC_NAME s_scm_setgroups +{ + size_t ngroups; + size_t size; + size_t i; + int result; + GETGROUPS_T *groups; + + SCM_VALIDATE_VECTOR (0, group_vec); + + ngroups = SCM_VECTOR_LENGTH (group_vec); + size = ngroups * sizeof (GETGROUPS_T); + /* XXX - if (ngroups / sizeof (GETGROUPS_T) != size) out-of-range */ + groups = scm_malloc (size); + for(i = 0; i < ngroups; i++) + { + SCM gid = SCM_VECTOR_REF (group_vec, i); + SCM_VALIDATE_INUM (0, gid); + groups [i] = SCM_INUM (gid); + } + + result = setgroups (ngroups, groups); + free (groups); + if (result < 0) + SCM_SYSERROR; + return SCM_UNSPECIFIED; +} +#undef FUNC_NAME +#endif + #ifdef HAVE_GETPWENT SCM_DEFINE (scm_getpwuid, "getpw", 0, 1, 0, (SCM user), paul _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel