diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-10-20 12:51:05 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-10-20 12:51:05 +0000 |
commit | e0fa5af24242618e2201252ebce12dfc87892dd1 (patch) | |
tree | 9f271ec1653228443cfb154e54ddbe50327efa9a | |
parent | 485caab953a6ba703128628417a156139b8e7a26 (diff) | |
download | perl-e0fa5af24242618e2201252ebce12dfc87892dd1.tar.gz |
Fix for ithreads/stdio build
p4raw-id: //depot/perlio@12529
-rw-r--r-- | perlio.c | 18 | ||||
-rw-r--r-- | perlsdio.h | 1 |
2 files changed, 18 insertions, 1 deletions
@@ -128,6 +128,24 @@ PerlIO_binmode(pTHX_ PerlIO *fp, int iotype, int mode, const char *names) #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 */ diff --git a/perlsdio.h b/perlsdio.h index a1d2bec4b3..d09b632228 100644 --- a/perlsdio.h +++ b/perlsdio.h @@ -13,7 +13,6 @@ #define PerlIO_stdout() stdout #define PerlIO_stdin() stdin -#define PerlIO_fdupopen(f) (f) #define PerlIO_isutf8(f) 0 #define PerlIO_printf fprintf |