aboutsummaryrefslogtreecommitdiffstats
path: root/pc/gawkmisc.pc
diff options
context:
space:
mode:
Diffstat (limited to 'pc/gawkmisc.pc')
-rw-r--r--pc/gawkmisc.pc12
1 files changed, 12 insertions, 0 deletions
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc
index 67760676..43f81ff9 100644
--- a/pc/gawkmisc.pc
+++ b/pc/gawkmisc.pc
@@ -280,6 +280,18 @@ int fd;
setmode(fd, orig_tty_mode);
}
}
+
+/* os_isatty --- return true if fd is a tty */
+
+int
+os_isatty(int fd)
+{
+#if defined(__MINGW32__) || defined(_MSC_VER)
+ return (isatty(fd) && lseek(fd, SEEK_CUR, 0) == -1);
+#else
+ return isatty(fd);
+#endif
+}
/* files_are_same --- return true if files are identical */