#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <pwd.h>

int main()
{
    uid_t uid = getuid();
    uid_t euid = geteuid();

    struct passwd *p_uid, *p_euid;

    p_uid = getpwuid(uid);
    p_euid = getpwuid(uid);

    printf("UID: %d (%s) Effective UID: %d (%s) Login: %s\n", uid, p_uid->pw_name, euid, p_euid->pw_name, getlogin());
}
