Sign in
nest-open-source
/
nest-learning-thermostat
/
5.0
/
util-linux-ng
/
3848152627d350905d73127b1683a65478fac29f
/
.
/
util-linux-ng-2.17.2
/
mount
/
getusername.c
blob: 9835768ca8cacf4561c448d4dbb3c1e8cc6ca094 [
file
] [
log
] [
blame
]
#include
<unistd.h>
#include
<pwd.h>
#include
<sys/types.h>
#include
"getusername.h"
char
*
getusername
()
{
char
*
user
=
0
;
struct
passwd
*
pw
=
getpwuid
(
getuid
());
if
(
pw
)
user
=
pw
->
pw_name
;
return
user
;
}