Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

getgroups.c File Reference

Print out the gids of all groups for the current user. More...

Go to the source code of this file.

Functions

int main (int argc, char *argv[])


Detailed Description

Print out the gids of all groups for the current user.

This is like `id -G` on Linux, but it's too hard to find a portable equivalent.

Definition in file getgroups.c.


Function Documentation

int main int    argc,
char *    argv[]
 

Definition at line 34 of file getgroups.c.

00035 {
00036         int n, i;
00037         gid_t list[NGROUPS];
00038 
00039         if ((n = getgroups(NGROUPS, list)) == -1) {
00040                 perror("getgroups");
00041                 return 1;
00042         }
00043 
00044         for (i = 0; i < n; i++) 
00045                 printf("%u ", list[i]);
00046         printf("\n");
00047                 
00048         return 0;
00049 }


Generated on Tue Apr 16 12:37:38 2002 for rsync by doxygen1.2.15