OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [linux/] [uClibc/] [test/] [pwd_grp/] [grcat.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
/*
2
 * grcat.c
3
 *
4
 * Generate a printable version of the group database
5
 */
6
/*
7
 * Arnold Robbins, arnold@gnu.org, May 1993
8
 * Public Domain
9
 */
10
 
11
#include <stdlib.h>
12
#include <stdio.h>
13
#include <grp.h>
14
 
15
int main(int argc, char **argv)
16
{
17
    struct group *g;
18
    int i;
19
 
20
    while ((g = getgrent()) != NULL) {
21
        printf("%s:%s:%ld:", g->gr_name, g->gr_passwd,
22
                (long) g->gr_gid);
23
        for (i = 0; g->gr_mem[i] != NULL; i++) {
24
            printf("%s", g->gr_mem[i]);
25
            if (g->gr_mem[i+1] != NULL)
26
                putchar(',');
27
        }
28
        putchar('\n');
29
    }
30
    endgrent();
31
    return 0;
32
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.