diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-11-21 08:45:06 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-11-21 08:45:06 +0000 |
commit | a7092146033201511b749e3a5ff31247e203604d (patch) | |
tree | 14f0599808ecedb698a5049d6b16390848911e68 /pp_sys.c | |
parent | e4449fe1872a24e805fcc129361ea26a406317d8 (diff) | |
download | perl-a7092146033201511b749e3a5ff31247e203604d.tar.gz |
another win32 portability fix: make sysread() and syswrite()
work on sockets
p4raw-id: //depot/perl@2255
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -1422,7 +1422,17 @@ PP(pp_sysread) Zero(buffer+bufsize, offset-bufsize, char); } if (PL_op->op_type == OP_SYSREAD) { - length = PerlLIO_read(PerlIO_fileno(IoIFP(io)), buffer+offset, length); +#ifdef PERL_SOCK_SYSREAD_IS_RECV + if (IoTYPE(io) == 's') { + length = PerlSock_recv(PerlIO_fileno(IoIFP(io)), + buffer+offset, length, 0); + } + else +#endif + { + length = PerlLIO_read(PerlIO_fileno(IoIFP(io)), + buffer+offset, length); + } } else #ifdef HAS_SOCKET__bad_code_maybe @@ -1534,7 +1544,17 @@ PP(pp_send) offset = 0; if (length > blen - offset) length = blen - offset; - length = PerlLIO_write(PerlIO_fileno(IoIFP(io)), buffer+offset, length); +#ifdef PERL_SOCK_SYSWRITE_IS_SEND + if (IoTYPE(io) == 's') { + length = PerlSock_send(PerlIO_fileno(IoIFP(io)), + buffer+offset, length, 0); + } + else +#endif + { + length = PerlLIO_write(PerlIO_fileno(IoIFP(io)), + buffer+offset, length); + } } #ifdef HAS_SOCKET else if (SP > MARK) { |