[Mono-bugs] [Bug 76192][Nor] Changed - Can't write files past 2gb on AMD64 (x86_64)

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Sep 23 11:39:05 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by dick at ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=76192

--- shadow/76192	2005-09-22 17:09:56.000000000 -0400
+++ shadow/76192.tmp.29806	2005-09-23 11:39:05.000000000 -0400
@@ -69,6 +69,30 @@
 
 Attached patch seems to get the offset flowing positively again and I can successfully write 
 out a 3000MB file on amd64 with it applied against 1.1.9. It's unclear to me whether 
 file_seek() is supposed to accept negative values here or what will happen to them, so this 
 might not be a totally correct patch.
 
+
+------- Additional Comments From dick at ximian.com  2005-09-23 11:39 -------
+the parameters are signed, as a negative offset means "move
+backwards". and the 64-bit resulting offset also needs to be signed.
+
+From MSDN:
+
+"If lpDistanceToMoveHigh is not NULL, then lpDistanceToMoveHigh and
+lDistanceToMove form a single 64-bit signed value. The lDistanceToMove
+parameter is treated as the low order 32-bits of the value, and
+lpDistanceToMoveHigh as the upper 32-bits, which means that
+lpDistanceToMoveHigh is a sign extension of lDistanceToMove.
+
+To move the file pointer from 0 (zero) to 2 gigabytes,
+lpDistanceToMoveHigh must be set to either NULL or a sign extension of
+lDistanceToMove. To move the pointer more than 2 gigabytes, use
+lpDistanceToMoveHigh and lDistanceToMove as a single 64-bit quantity.
+For example, to move in the range from 2 gigabytes to 4 gigabytes set
+the contents of lpDistanceToMoveHigh to zero (0), or to –1 for a
+negative sign extension of lDistanceToMove. "
+
+I still might have the casting wrong, but I don't think your patch is
+correct either - it should result in a signed 64 bit value not an
+unsigned.


More information about the mono-bugs mailing list