Skip to content
Snippets Groups Projects
Commit 6ae96391 authored by Avi Kivity's avatar Avi Kivity
Browse files

libc: implement getpwuid()

parent 93c55b7d
No related branches found
No related tags found
No related merge requests found
...@@ -181,6 +181,21 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, ...@@ -181,6 +181,21 @@ int getpwuid_r(uid_t uid, struct passwd *pwd,
return 0; return 0;
} }
struct passwd* getpwuid(uid_t uid)
{
static struct passwd ret;
static char buf[300];
struct passwd *p;
int e;
e = getpwuid_r(uid, &ret, buf, sizeof(buf), &p);
if (e == 0) {
return &ret;
} else {
return libc_error_ptr<passwd>(e);
}
}
int uname(struct utsname* u) int uname(struct utsname* u)
{ {
// lie, to avoid confusing the payload. // lie, to avoid confusing the payload.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment