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