unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: prj@po.cwru.edu (Paul Jarc)
Subject: Re: setgroups
Date: Fri, 18 Apr 2003 13:49:53 -0400	[thread overview]
Message-ID: <m3znmnr8yw.fsf@multivac.cwru.edu> (raw)
In-Reply-To: <m365pbso1v.fsf@multivac.cwru.edu> (Paul Jarc's message of "Fri, 18 Apr 2003 13:38:46 -0400")

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


  reply	other threads:[~2003-04-18 17:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m3y928ripu.fsf@multivac.cwru.edu>
2003-04-17 22:29 ` setgroups Rob Browning
2003-04-17 22:43   ` setgroups Paul Jarc
2003-04-17 23:10     ` setgroups Marius Vollmer
2003-04-18  3:19     ` setgroups Rob Browning
2003-04-17 23:20   ` setgroups Paul Jarc
2003-04-18  3:34     ` setgroups Rob Browning
2003-04-18 10:31       ` setgroups Marius Vollmer
2003-04-18 15:37         ` setgroups Paul Jarc
2003-04-18 17:38           ` setgroups Paul Jarc
2003-04-18 17:49             ` Paul Jarc [this message]
2003-04-21 16:20               ` setgroups Paul Jarc
2003-04-18 15:41         ` setgroups Rob Browning
2003-04-18 16:00           ` setgroups Paul Jarc
2003-04-18 17:01             ` setgroups Rob Browning

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3znmnr8yw.fsf@multivac.cwru.edu \
    --to=prj@po.cwru.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).