[patch, fortran] Large transfer support for IO library

Richard Henderson rth@redhat.com
Thu Sep 29 20:49:00 GMT 2005


On Wed, Sep 28, 2005 at 11:19:51PM +0300, Janne Blomqvist wrote:
> +  /* Requests between SSIZE_MAX and SIZE_MAX are undefined by SUS, in
> +     that case we do two writes.  */

You can't rely on doing this in exactly two writes.  Or transfers
less that SSIZE_MAX in exactly one write.  On some systems, signals
do not restart system calls.  So you need to stay in a loop like

	while (bytes_left > 0)
	  {
	    transfer = min (bytes_left, ssize_max);
	    transfer = write (..., transfer);
	    if (transfer < 0)
	      error;
	    bytes_left -= transfer;
	  }

Similarly for reads.


r~



More information about the Gcc-patches mailing list