title: Why is explain_fwrite saying my file marked as non-blocking?
body: <p>I'm trying to write some data to a file. fwrite is returning EAGAIN and fwrite_explain says:</p>
  <pre><code>2: fwrite(ptr = 0x7F41EFBC09A8, size = 4066, nmemb = 1, fp = 0x02F79200 &quot;/home/user/asdf.txt&quot;) failed, Resource temporarily unavailable (11, EAGAIN) because the file descriptor has been marked non-blocking (O_NONBLOCK) and the write would block
  2: fwrite(ptr = 0x17ECFFA40, size = 4066, nmemb = 1, fp = 0x02F79200 &quot;/home/user/asdf.txt&quot;) failed, No such file or directory (2, ENOENT) because the file is on a file system (&quot;/home&quot;, 1% full) which does not support Unix open file semantics, and the file has been deleted from underneath you
  2: fwrite(ptr = 0x17ECFF100, size = 4066, nmemb = 1, fp = 0x02F79200 &quot;/home/user/asdf.txt&quot;) failed, No such file or directory (2, ENOENT) because the file is on a file system (&quot;/home&quot;, 1% full) which does not support Unix open file semantics, and the file has been deleted from underneath you
  </code></pre>
  <p>I assume the second set of warnings are invalid (the file never gets removed, it's still there).</p>
  <p>I never set my file as non-blocking, and I don't care if it blocks because I want to write the data, regardless of how long it may take. What gives?</p>
  <p>The relevant code:</p>
  <pre><code>fd = fopen(file_to_write, &quot;w&quot;);
  if (fd == NULL) printf(&quot;%d could not open file\n&quot;, errno);
  n = fwrite((void*)h-&gt;bufs[i], write_size, 1, fd);
  if (n != write_size) {
      printf(&quot;%d: %s\n&quot;, errno, explain_fwrite((void*)h-&gt;bufs[i], write_size, 1, fd));
  </code></pre>