2014-08-27 09:12:33 +04:00
|
|
|
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
|
|
|
* This file is part of ToaruOS and is released under the terms
|
2014-06-08 10:13:29 +04:00
|
|
|
* of the NCSA / University of Illinois License - see LICENSE.md
|
|
|
|
* Copyright (C) 2013-2014 Kevin Lange
|
2012-01-28 04:04:39 +04:00
|
|
|
*
|
|
|
|
* Who Am I?
|
|
|
|
*
|
|
|
|
*/
|
2014-05-12 04:40:16 +04:00
|
|
|
#include <unistd.h>
|
2012-01-28 04:04:39 +04:00
|
|
|
#include <stdio.h>
|
2012-01-29 08:27:37 +04:00
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
2014-08-27 09:12:33 +04:00
|
|
|
#include <pwd.h>
|
2012-01-28 04:04:39 +04:00
|
|
|
|
|
|
|
int main(int argc, char ** argv) {
|
2014-08-27 09:12:33 +04:00
|
|
|
struct passwd * p = getpwuid(getuid());
|
|
|
|
if (!p) return 0;
|
2012-01-28 04:04:39 +04:00
|
|
|
|
2014-08-27 09:12:33 +04:00
|
|
|
fprintf(stdout, "%s\n", p->pw_name);
|
2012-01-28 04:04:39 +04:00
|
|
|
|
2014-08-27 09:12:33 +04:00
|
|
|
endpwent();
|
2012-01-28 04:04:39 +04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|