myshellin/src/user.c

10 lines
160 B
C
Raw Normal View History

#include <pwd.h>
#include <stdio.h>
#include <unistd.h>
char *get_user() {
struct passwd *pass;
pass = getpwuid(getuid());
return pass->pw_name;
}