p4raw-id: //depot/perlio@12529
#endif
}
+PerlIO *
+PerlIO_fdupopen(pTHX_ PerlIO *f, CLONE_PARAMS *param)
+{
+ if (f) {
+ int fd = PerlLIO_dup(PerlIO_fileno(f));
+ if (fd >= 0) {
+ /* the r+ is a hack */
+ return PerlIO_fdopen(fd, "r+");
+ }
+ return NULL;
+ }
+ else {
+ SETERRNO(EBADF, SS$_IVCHAN);
+ }
+ return NULL;
+}
+
+
/*
* De-mux PerlIO_openn() into fdopen, freopen and fopen type entries
*/
#define PerlIO_stdout() stdout
#define PerlIO_stdin() stdin
-#define PerlIO_fdupopen(f) (f)
#define PerlIO_isutf8(f) 0
#define PerlIO_printf fprintf