Mail Archives: djgpp-workers/2005/04/10/19:16:30
On Sun, 10 Apr 2005 22:09:08 +0300, Eli Zaretskii <eliz AT gnu DOT org>
wrote:
>> Date: Sun, 10 Apr 2005 11:30:46 -0600
>> From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
>>
>> Last buffer isn't written at all: you might want to try adding
>> fflush() every 1000 bytes from 4 294 950 000, every 100 bytes from
>> 4 294 960 000, and maybe every 10 bytes from 4 294 963 200, as you may
>> only get up to 4GB-4KB == 4 294 963 200 written, but may get to 4GB-6
>> == 4 294 967 290 (limit due to writing 10 bytes a time), and might
>> have to write and fflush a byte at a time to get further than that.
>
>Isn't it easier to install a SIGINT signal handler, which will fflush
>the stream and exit?
The issue is the amount of data in the library buffer to be flushed to
the OS: once there's too much in the buffer, the write will not
complete and you'll get an error; so you have to reduce the write
granularity near the end, if you don't want to take all day doing 4GB
of small writes to determine the limit.
--
Thanks. Take care, Brian Inglis Calgary, Alberta, Canada
Brian DOT Inglis AT CSi DOT com (Brian[dot]Inglis{at}SystematicSW[dot]ab[dot]ca)
fake address use address above to reply
- Raw text -