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

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

Gurusamy Sarathy
March 15, 2000 10:17
Re: perl 5.6.RC2 pp_sys.c problem (AIX - partial solution?
Message ID:
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.

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. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About