summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/libcruft/getgrnam.c
blob: 1bdbb42a80b541defabe91d713adedd4765861a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <grp.h>
#include <string.h>
#include <stdlib.h>

struct group *getgrnam(const char* name) {
  struct group *tmp;
  setgrent();
  for (;;) {
    tmp=getgrent();
    if (!tmp) return 0;
    if (!strcmp(tmp->gr_name,name))
      return tmp;
  }
}