2.9BSD/usr/src/lib/c/stdio/getpwuid.c

Compare this file to the similar file:
Show the results in this format:

/*	@(#)getpwuid.c	2.2	SCCS id keyword	*/
#include <whoami.h>
#include <pwd.h>

struct passwd *
getpwuid(uid)
register uid;
{
	register struct passwd *p;
	struct passwd *getpwent();

#ifdef UCB_PWHASH
	if( !(p = getpwmap(getmapuid(uid))) ) {
#endif
	setpwent();
	while( (p = getpwent()) && p->pw_uid != uid );
#ifdef UCB_PWHASH
	}
#endif
	endpwent();
	return(p);
}