Put back the cygwin32 Configure fix of 3582 undone by 3597.
[p5sagit/p5-mst-13.2.git] / pp_sys.c
index 9600174..483ddce 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -46,6 +46,9 @@ extern "C" int syscall(unsigned long,...);
 
 #if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */
 # include <sys/socket.h>
+# if defined(USE_SOCKS) && defined(I_SOCKS)
+#   include <socks.h>
+# endif 
 # ifdef I_NETDB
 #  include <netdb.h>
 # endif
@@ -1462,6 +1465,10 @@ PP(pp_sysread)
 #else
        bufsize = sizeof namebuf;
 #endif
+#ifdef OS2     /* At least Warp3+IAK: only the first byte of bufsize set */
+       if (bufsize >= 256)
+           bufsize = 255;
+#endif
        buffer = SvGROW(bufsv, length+1);
        /* 'offset' means 'flags' here */
        length = PerlSock_recvfrom(PerlIO_fileno(IoIFP(io)), buffer, length, offset,