1: /* @(#)getpwuid.c 2.2 SCCS id keyword */ 2: #include <whoami.h> 3: #include <pwd.h> 4: 5: struct passwd * 6: getpwuid(uid) 7: register uid; 8: { 9: register struct passwd *p; 10: struct passwd *getpwent(); 11: 12: #ifdef UCB_PWHASH 13: if( !(p = getpwmap(getmapuid(uid))) ) { 14: #endif 15: setpwent(); 16: while( (p = getpwent()) && p->pw_uid != uid ); 17: #ifdef UCB_PWHASH 18: } 19: #endif 20: endpwent(); 21: return(p); 22: }