fsync.html 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <html>
  2. <head>
  3. <title>fsync</title>
  4. <body bgcolor=#ffffff>
  5. <h2 align=center>fsync</h2>
  6. <h4 align=center>OS/161 Reference Manual</h4>
  7. <h3>Name</h3>
  8. fsync - flush filesystem data for a specific file to disk
  9. <h3>Library</h3>
  10. Standard C Library (libc, -lc)
  11. <h3>Synopsis</h3>
  12. #include &lt;unistd.h&gt;<br>
  13. <br>
  14. int<br>
  15. fsync(int <em>fd</em>);
  16. <h3>Description</h3>
  17. The fsync function forces a write of dirty filesystem buffers and
  18. other dirty filesystem state associated with the object referred to by
  19. <em>fd</em> to be written to disk.
  20. <p>
  21. fsync should not return until the writes are complete.
  22. <p>
  23. <h3>Return Values</h3>
  24. On success, fsync returns 0. On error, -1 is returned, and
  25. <A HREF=errno.html>errno</A> is set according to the error
  26. encountered.
  27. <h3>Errors</h3>
  28. The following error codes should be returned under the conditions
  29. given. Other error codes may be returned for other errors not
  30. mentioned here.
  31. <blockquote><table width=90%>
  32. <td width=10%>&nbsp;</td><td>&nbsp;</td></tr>
  33. <tr><td>EBADF</td> <td><em>fd</em> is not a valid file handle.</td></tr>
  34. <tr><td>EIO</td> <td>A hard I/O error occurred.</td></tr>
  35. </table></blockquote>
  36. </body>
  37. </html>