diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-01-28 23:17:20 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-01-28 23:17:20 +0000 |
commit | a5936e02e328fcaa28fdb01e8a749a151ee539cf (patch) | |
tree | abeb1b429bf6b15d2b3c4f4b4f619c036bf0883d /djgpp | |
parent | e2c38acd50687b4f8312524543d05a81d8096797 (diff) | |
download | perl-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.c | 13 |
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; +} + |