statBuf.st_uid -> username? [Archive] - C Board

PDA

View Full Version : statBuf.st_uid -> username?


samGwilliam
02-19-2002, 07:11 AM
How do I get the user's name from their user id number?

rohit
02-19-2002, 08:14 AM
#include <pwd.h>
struct passwd * getpwuid(int uid)

struct passwd is
{char* pw_name;
char * pw_passwd;
.... bla bla
};see man getpwuid