⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fsync.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>fsync</title></head><body bgcolor=white><center><font size=2>The Single UNIX &reg; Specification, Version 2<br>Copyright &copy; 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_005_320">&nbsp;</a>NAME</h4><blockquote>fsync - synchronise changes to a file</blockquote><h4><a name = "tag_000_005_321">&nbsp;</a>SYNOPSIS</h4><blockquote><pre><code>#include &lt;<a href="unistd.h.html">unistd.h</a>&gt;int fsync(int <i>fildes</i>);</code></pre></blockquote><h4><a name = "tag_000_005_322">&nbsp;</a>DESCRIPTION</h4><blockquote>The<i>fsync()</i>function can be used by an application to indicate that alldata for the open file description named by<i>fildes</i>is to be transferred to the storage device associated withthe file described by<i>fildes</i>in an implementation-dependent manner.The<i>fsync()</i>function does not return until the system has completed that actionor until an error is detected.<p>The<i>fsync()</i>function forces all currently queued I/O operations associated with the file indicated by file descriptor<i>fildes</i>to the synchronised I/O completion state.All I/O operations are completed as defined forsynchronised I/O file integrity completion.</blockquote><h4><a name = "tag_000_005_323">&nbsp;</a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>fsync()</i>returns 0.  Otherwise, -1 is returned and<i>errno</i>is set to indicate the error.If the<i>fsync()</i>function fails,outstanding I/O operations are not guaranteed to have been completed.</blockquote><h4><a name = "tag_000_005_324">&nbsp;</a>ERRORS</h4><blockquote>The<i>fsync()</i>function will fail if:<dl compact><dt>[EBADF]<dd>The<i>fildes</i>argument is not a valid descriptor.<dt>[EINTR]<dd>The<i>fsync()</i>function was interrupted by a signal.<dt>[EINVAL]<dd>The<i>fildes</i>argument does not refer to a file on which this operationis possible.<dt>[EIO]<dd>An I/O error occurred while reading from or writing to the file system.</dl><p>In the event that any of the queued I/O operations fail,<i>fsync()</i>returns the error conditions defined for<i><a href="read.html">read()</a></i>and<i><a href="write.html">write()</a></i>.</blockquote><h4><a name = "tag_000_005_325">&nbsp;</a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_326">&nbsp;</a>APPLICATION USAGE</h4><blockquote>The<i>fsync()</i>functionshould be used by programs which require modifications to a fileto be completed before continuing; for example, a program which containsa simple transaction facility might use it to ensure that allmodifications to a file or files caused by a transaction arerecorded.</blockquote><h4><a name = "tag_000_005_327">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_328">&nbsp;</a>SEE ALSO</h4><blockquote><i><a href="sync.html">sync()</a></i>,<i><a href="unistd.h.html">&lt;unistd.h&gt;</a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX &reg; is a registered Trademark of The Open Group.<br>Copyright &copy; 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -