k9core/src/whoami.c

11 lines
161 B
C
Raw Normal View History

2020-07-08 06:07:01 +00:00
#include <pwd.h>
#include <stdio.h>
2020-07-08 05:33:43 +00:00
#include <unistd.h>
2020-07-08 06:07:01 +00:00
2020-07-08 05:33:43 +00:00
int
main(void)
{
struct passwd* user_data = getpwuid(getuid());
printf("%s\n", user_data->pw_name);
2020-07-08 05:33:43 +00:00
}