micro-utils/coreutils/logname.c
Your Name 3bbadc8f11 .
2023-10-24 13:59:42 +03:00

17 lines
249 B
C

#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
int main(void) {
char *p = getlogin();
if (p != NULL) {
puts(p);
return 0;
}
fprintf(stderr, "logname: %s\n", strerror(errno));
return 1;
}