#include <stdlib.h>
#include <stdio.h>
#include <pwd.h>
int main(int argc, char* argv[])
{
struct passwd *ptPWD = getpwnam("daemon");
if(ptPWD != NULL)
{
printf("uid=%d,gid=%d\r\n", ptPWD->pw_uid, ptPWD->pw_gid);
}
else
printf("NULL\r\n");
return 0;
}
#include <stdio.h>
#include <pwd.h>
int main(int argc, char* argv[])
{
struct passwd *ptPWD = getpwnam("daemon");
if(ptPWD != NULL)
{
printf("uid=%d,gid=%d\r\n", ptPWD->pw_uid, ptPWD->pw_gid);
}
else
printf("NULL\r\n");
return 0;
}