P8000/WEGA/contrib/lcc/lib/libc/port/gen/getpwuid.c

18 lines
266 B
C

#include <pwd.h>
extern struct passwd *getpwent();
extern int setpwent(), endpwent();
struct passwd *
getpwuid(uid)
register uid;
{
register struct passwd *p;
(void) setpwent();
while((p = getpwent()) && p->pw_uid != uid)
;
(void) endpwent();
return(p);
}