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

struct passwd *getpwnam(const char * name) {
  struct passwd *tmp;
  setpwent();
  for (;;) {
    tmp=getpwent();
    if (!tmp) return 0;
    if (!strcmp(tmp->pw_name,name))
      return tmp;
  }
}