File: gsgroups.c

package info (click to toggle)
super 3.11.6-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 660 kB
  • ctags: 592
  • sloc: ansic: 7,338; sh: 183; makefile: 175
file content (38 lines) | stat: -rw-r--r-- 1,232 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
static char rcsid[] = "$Id: gsgroups.c,v 1.6 1998/03/02 06:53:59 will Exp $";
/* This silly little file is here because gcc messes up badly with
 * prototyping the getgroups() / setgroups() functions on SunOS.
 * The problem is that on SunOS 4.x, there are two versions of each of
 * these functions: the usual (non-SysV) version takes an array of ints:
 * 	[gs]etgroups(int, int *)
 * but the Sys V version takes an array of gid_t's:
 * 	[gs]etgroups(int, gid_t *).
 * Unfortunately, gcc insists on the latter.  This isn't right for
 * most compilations -- it won't work unless you link with the
 * /usr/5lib version of libc.

 * Hence this little file: it invokes [gs]etgroups declaring its
 * argument as pointer to void, and _hope_ that this is the same
 * size pointer as (gid_t *), (uid_t *), and (int *).  If it is,
 * all will work smoothly on any host, yet we avoid including
 * the file <sys/unistd.h> wherein getgroups is inappropriately
 * prototyped.
 */
#include "config.h"

#ifdef HAVE_GETGROUPS
int Setgroups(n, g)
int n;
void *g;
{
    int setgroups __P((int, void *));
    return setgroups(n, g);
}
 
int Getgroups(n, g)
int n;
void *g;
{
    int getgroups __P((int, void *));
    return getgroups(n, g);
}
#endif