summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/libcruft/getpwuid.c
blob: eef14e6e89ea1163b3d4166b855a826bcfc78800 (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 *getpwuid(uid_t uid) {
  struct passwd *tmp;
  setpwent();
  for (;;) {
    tmp=getpwent();
    if (!tmp) return 0;
    if (tmp->pw_uid==uid)
      return tmp;
  }
}