mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
9886b27d9c
Also add a little /etc/passwd database. There's just me in there.
16 lines
282 B
C++
16 lines
282 B
C++
#include <LibC/unistd.h>
|
|
#include <LibC/stdio.h>
|
|
#include <LibC/pwd.h>
|
|
|
|
int main(int c, char** v)
|
|
{
|
|
uid_t uid = getuid();
|
|
gid_t gid = getgid();
|
|
|
|
struct passwd* pw = getpwuid(uid);
|
|
|
|
printf("uid=%u(%s), gid=%u\n", uid, pw ? pw->pw_name : "n/a", gid);
|
|
return 0;
|
|
}
|
|
|