summaryrefslogtreecommitdiff
path: root/djgpp
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-01-28 23:17:20 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-01-28 23:17:20 +0000
commita5936e02e328fcaa28fdb01e8a749a151ee539cf (patch)
treeabeb1b429bf6b15d2b3c4f4b4f619c036bf0883d /djgpp
parente2c38acd50687b4f8312524543d05a81d8096797 (diff)
downloadperl-a5936e02e328fcaa28fdb01e8a749a151ee539cf.tar.gz
Workaround for DJGPP broken F_GETFL from Laszlo.
p4raw-id: //depot/perl@14485
Diffstat (limited to 'djgpp')
-rw-r--r--djgpp/djgpp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/djgpp/djgpp.c b/djgpp/djgpp.c
index 0e465b0f82..4c53eb09c8 100644
--- a/djgpp/djgpp.c
+++ b/djgpp/djgpp.c
@@ -441,3 +441,16 @@ djgpp_fflush (FILE *fp)
return res;
}
+
+int djgpp_get_stream_mode(FILE *f)
+{
+ extern char *__file_handle_modes;
+
+ int mode = __file_handle_modes[fileno(f)];
+ if (f->_flag & _IORW)
+ return mode | O_RDWR;
+ if (f->_flag & _IOWRT)
+ return mode | O_WRONLY;
+ return mode | O_RDONLY;
+}
+