projects
/
musl
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
8ad0b9f3b90377080ef92cf872827723abd3c2eb
[musl]
/
src
/
misc
/
cuserid.c
1
#include <pwd.h>
2
#include <stdio.h>
3
#include <unistd.h>
4
5
char *cuserid(char *buf)
6
{
7
struct passwd pw, *ppw;
8
long pwb[256];
9
if (getpwuid_r(geteuid(), &pw, (void *)pwb, sizeof pwb, &ppw))
10
return 0;
11
snprintf(buf, L_cuserid, "%s", pw.pw_name);
12
return buf;
13
}