p4raw-id: //depot/perl@14485
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;
+}
+
if (fd >= 0) {
char mode[8];
int omode = fcntl(fd, F_GETFL);
+#ifdef DJGPP
+ omode = djgpp_get_stream_mode(f);
+#endif
PerlIO_intmode2str(omode,mode,NULL);
/* the r+ is a hack */
return PerlIO_fdopen(fd, mode);