title: efficiency of fwrite for massive numbers of small writes
body: <p>I have a program that saves many large files >1GB using <code>fwrite</code> It works fine, but unfortunately due to the nature of the data each call to <code>fwrite</code> only writes 1-4bytes. with the result that the write can take over an hour, with most of this time seemingly due to the syscall overhead (or at least in the library function of fwrite).  I have a similar problem with <code>fread</code>.</p>
  
  <p>Does anyone know of any existing / library functions that will buffer these writes and reads with an inline function, or is this another roll your own?</p>