develooper Front page | perl.perl5.porters | Postings from March 2000

Re: perl 5.6.RC2 pp_sys.c problem (AIX 4.3.3.11) - partial solution?

From:
Gurusamy Sarathy
Date:
March 15, 2000 10:17
Subject:
Re: perl 5.6.RC2 pp_sys.c problem (AIX 4.3.3.11) - partial solution?
Message ID:
200003151816.KAA16426@maul.ActiveState.com
On Wed, 15 Mar 2000 09:31:59 CST, "David R. Favor" wrote:
>Note that the write() function in AIX takes the following arguments:
>
>   ssize_t write (FileDescriptor, Buffer, NBytes)
>   int FileDescriptor;
>   const void *Buffer;
>   size_t NBytes;
>
>
>Note the difference in size between size_t and Off_t.

This is a bug in Perl, pure and simple.  We should be using the
right type for the "length" parameter.

Please try this.  It isn't quite the right fix, because it really
needs to be Size_t, and the return value from the write() a SSize_t,
but this should suffice to test it.


Sarathy
gsar@ActiveState.com
-----------------------------------8<-----------------------------------
Index: perl/pp_sys.c
--- perl/pp_sys.c.~1~	Wed Mar 15 10:11:40 2000
+++ perl/pp_sys.c	Wed Mar 15 10:11:40 2000
@@ -1591,7 +1591,7 @@
     Off_t offset;
     SV *bufsv;
     char *buffer;
-    Off_t length;
+    SSize_t length;
     STRLEN blen;
     MAGIC *mg;
 
End of Patch.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About