about summary refs log tree commit diff
path: root/src/unistd
diff options
context:
space:
mode:
Diffstat (limited to 'src/unistd')
-rw-r--r--src/unistd/isatty.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/unistd/isatty.c b/src/unistd/isatty.c
index cff6e9fe..c8badaf5 100644
--- a/src/unistd/isatty.c
+++ b/src/unistd/isatty.c
@@ -1,8 +1,9 @@
 #include <unistd.h>
-#include <termios.h>
+#include <sys/ioctl.h>
+#include "syscall.h"
 
 int isatty(int fd)
 {
-	struct termios t;
-	return tcgetattr(fd, &t) == 0;
+	struct winsize wsz;
+	return !__syscall(SYS_ioctl, fd, TIOCGWINSZ, &wsz);
 }