From 478e6d562e5d6fd3abb8daed7e47d78cc832a1a3 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Fri, 14 Aug 2020 19:26:43 -0400 Subject: quick and dirty implementation --- src/unistd/getlogin.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/unistd/getlogin.c b/src/unistd/getlogin.c index 462b5a6d..bd110395 100644 --- a/src/unistd/getlogin.c +++ b/src/unistd/getlogin.c @@ -1,11 +1,15 @@ #include "stddef.h" #include "sys/types.h" #include +#include "stdlib.h" char * getlogin(void) { - return 0; + /* TODO: get actual controlling terminal, then read utmpx */ + + return getenv("LOGNAME"); } + /* POSIX(1) */ -- cgit v1.2.1