Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
musl
/
6fce6ca129c34d8975f777216d32cf92e77c18f2
/
.
/
src
/
unistd
/
getlogin_r.c
blob: 53866c6dce4077d8a53ba118a6460c2f2e6f55ee [
file
] [
log
] [
blame
]
#include
<unistd.h>
#include
<string.h>
#include
<errno.h>
int
getlogin_r
(
char
*
name
,
size_t
size
)
{
char
*
logname
=
getlogin
();
if
(!
logname
)
return
ENXIO
;
/* or...? */
if
(
strlen
(
logname
)
>=
size
)
return
ERANGE
;
strcpy
(
name
,
logname
);
return
0
;
}