From 1094cc8c40864c10516f44ef04458f5a2c455868 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Sat, 2 Mar 2019 11:14:02 -0500 Subject: correct inline definition of isatty() --- src/nonstd/__libc_start.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nonstd/__libc_start.c b/src/nonstd/__libc_start.c index 550eae6b..ca3e8245 100644 --- a/src/nonstd/__libc_start.c +++ b/src/nonstd/__libc_start.c @@ -10,7 +10,12 @@ #else #define DEFAULT_LOCALE "C" #include "nonstd/syscall.h" -#define isatty(fd) __syscall(__lookup("tty"), fd) +#include "../termios/NCCS.c" +#include "../termios/cc_t.c" +#include "../termios/tcflag_t.c" +#include "../termios/struct_termios.c" +static struct termios __tios; +#define isatty(fd) (__syscall(__lookup("tcgetattr"), fd, &__tios) == 0) #endif void __libc_start(int argc, char **argv) -- cgit v1.2.1