title: fwrite() return value does not match with file size
body: <p>I am using <code>fwrite()</code> to write data to the file in a loop. It repeats for 40 times, but during the first <code>fwrite()</code> last few KBs are not written to the file. Whereas the consecutive <code>fwrite()</code> works fine.When I run for a single chunk say,4000 bytes <code>fwrite()</code> returns 4000, but the file content is less than 4000 (nearly 3000 bytes). There is no error reported during <code>perror()</code> also. Kindly help me in this and thanks in advance.</p>