012345678910111213141516
// logname.c, version 1.0.1 // OMKOV coreutils implementation of POSIX logname // Copyright (C) 2020, Jakob Wakeling // MIT Licence #include "util/error.h" #include <unistd.h> #include <stdio.h> int main(void) { register char *login = getlogin(); if (!login) { error(1, "%s", serr()); } else { puts(login); } return 0; }