7 char *cuserid(char *buf)
9 static char usridbuf[L_cuserid];
10 struct passwd pw, *ppw;
13 getpwuid_r(geteuid(), &pw, (void *)pwb, sizeof pwb, &ppw);
16 size_t len = strnlen(pw.pw_name, L_cuserid);
19 if (!buf) buf = usridbuf;
20 memcpy(buf, pw.pw_name, len+1);