aboutsummaryrefslogtreecommitdiffstats
path: root/win32/win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index b212d3874c..1e30ffec9b 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -3424,6 +3424,20 @@ rb_w32_snprintf(char *buf, size_t size, const char *format, ...)
return ret;
}
+int
+rb_w32_isatty(int fd)
+{
+ if (!(_osfile(fd) & FOPEN)) {
+ errno = EBADF;
+ return 0;
+ }
+ if (!(_osfile(fd) & FDEV)) {
+ errno = ENOTTY;
+ return 0;
+ }
+ return 1;
+}
+
//
// Fix bcc32's stdio bug
//