[BusyBox-cvs] busybox.stable/pwd_grp setgroups.c,1.6,1.7

Erik Andersen andersen at busybox.net
Mon Nov 3 20:10:45 UTC 2003


Update of /var/cvs/busybox.stable/pwd_grp
In directory winder:/tmp/cvs-serv17852/pwd_grp

Modified Files:
	setgroups.c 
Log Message:
Switch to using syscall() if possible, but still accomodate
old broken libc5....


Index: setgroups.c
===================================================================
RCS file: /var/cvs/busybox.stable/pwd_grp/setgroups.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- setgroups.c	12 Mar 2002 00:33:10 -0000	1.6
+++ setgroups.c	3 Nov 2003 20:10:42 -0000	1.7
@@ -2,8 +2,7 @@
 /*
  * Taken from the set of syscalls for uClibc
  *
- * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
- * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee at debian.org>
+ * Copyright (C) 1999-2003 by Erik Andersen <andersen at codepoet.org>
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Library General Public License as published by
@@ -21,6 +20,8 @@
  *
  */
 
+#include "busybox.h" 
+
 #include <errno.h>
 #include <unistd.h>
 #include <features.h>
@@ -29,12 +30,14 @@
    _syscall* defined.  */
 #define __LIBRARY__
 #include <sys/syscall.h>
-#if __GNU_LIBRARY__ < 5
-/* This is needed for libc5 */
-#include <asm/unistd.h>
-#endif
-#include "grp.h"
+#include "grp_.h"
 
+#if __GNU_LIBRARY__ < 5
 //#define __NR_setgroups        81
 _syscall2(int, setgroups, size_t, size, const gid_t *, list);
-
+#else
+int setgroups(size_t size, const gid_t * list)
+{
+	return(syscall(__NR_setgroups, size, list));
+}
+#endif




More information about the busybox-cvs mailing list