aboutsummaryrefslogtreecommitdiff
path: root/whoami.c
blob: 3d1cae9df23ed5184bd35e2abe39a35c5f63e634 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "whoami.h"

int main(void) {
    struct passwd *p;

    if (!(p = getpwuid(getuid()))) {
        exit(EXIT_FAILURE);
    }

    printf("%s\n", p->pw_name);

    exit(EXIT_SUCCESS);
}