Sign in
plan9port
/
plan9
/
c99867c9e05dd31fce28ae16aad083e893514f5a
/
.
/
src
/
lib9
/
getuser.c
blob: 09c070419fcf7b0da6e424eca4f277894247243c [
file
] [
log
] [
blame
]
#include
<u.h>
#include
<pwd.h>
#include
<libc.h>
char
*
getuser
(
void
)
{
static
char
user
[
64
];
struct
passwd
*
pw
;
pw
=
getpwuid
(
getuid
());
if
(
pw
==
nil
)
return
"none"
;
strecpy
(
user
,
user
+
sizeof
user
,
pw
->
pw_name
);
return
user
;
}