aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r--libgfortran/io/unix.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index 1a4bedd..ca96c22 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -218,6 +218,17 @@ fix_fd (int fd)
return fd;
}
+int
+is_preconnected (stream * s)
+{
+ int fd;
+
+ fd = ((unix_stream *) s)->fd;
+ if (fd == STDIN_FILENO || fd == STDOUT_FILENO || fd == STDERR_FILENO)
+ return 1;
+ else
+ return 0;
+}
/* write()-- Write a buffer to a descriptor, allowing for short writes */