|
1 #include <stdio.h>
2 #include <sys/types.h>
3 #include <pwd.h>
4 #include <unistd.h>
5
6 int
7 main(int argc, char ** argv)
8 {
9 uid_t uid;
10 struct passwd * user_info;
11
12 uid = getuid();
13 if ((user_info = getpwuid(uid)) != NULL)
14 printf("%s\n", user_info->pw_name);
15 return 0;
16 } |
|