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

📄 sleep.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>sleep</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_008_795">&nbsp;</a>NAME</h4><blockquote>sleep - suspend execution for an interval of time</blockquote><h4><a name = "tag_000_008_796">&nbsp;</a>SYNOPSIS</h4><blockquote><pre><code>#include &lt;<a href="unistd.h.html">unistd.h</a>&gt;unsigned int sleep(unsigned int <i>seconds</i>);</code></pre></blockquote><h4><a name = "tag_000_008_797">&nbsp;</a>DESCRIPTION</h4><blockquote>The<i>sleep()</i>function will cause the calling thread to be suspended fromexecution until either the number of real-time seconds specifiedby the argument<i>seconds</i>has elapsed or a signal is delivered to the calling thread and its action is to invoke a signal-catching function or toterminate the process.The suspension time may be longer than requested due to thescheduling of other activity by the system.<p>If a SIGALRM signal is generated for the calling process duringexecution of<i>sleep()</i>and if the SIGALRM signal is being ignored or blockedfrom delivery, it is unspecified whether<i>sleep()</i>returns when the SIGALRM signal is scheduled.If the signal is being blocked, it is also unspecified whether itremains pending after<i>sleep()</i>returns or it is discarded.<p>If a SIGALRM signal is generated for the calling process duringexecution of<i>sleep()</i>,except as a result of a prior call to<i><a href="alarm.html">alarm()</a></i>,and if the SIGALRM signal is not being ignored orblocked from delivery, it is unspecified whether that signal hasany effect other than causing<i>sleep()</i>to return.<p>If a signal-catching function interrupts<i>sleep()</i>and examines or changes either the time a SIGALRM isscheduled to be generated, the action associated with the SIGALRMsignal, or whether the SIGALRM signal is blocked from delivery,the results are unspecified.<p>If a signal-catching function interrupts<i>sleep()</i>and calls<i><a href="siglongjmp.html">siglongjmp()</a></i>or<i><a href="longjmp.html">longjmp()</a></i>to restore an environment saved prior to the<i>sleep()</i>call, the action associated with the SIGALRM signal and the timeat which a SIGALRM signal is scheduled to be generated areunspecified.It is also unspecified whether the SIGALRM signal is blocked,unless the process' signal mask is restored as part of theenvironment.<p>Interactions between<i>sleep()</i>and any of<i><a href="setitimer.html">setitimer()</a></i>,<i><a href="ualarm.html">ualarm()</a></i>or<i><a href="usleep.html">usleep()</a></i>are unspecified.</blockquote><h4><a name = "tag_000_008_798">&nbsp;</a>RETURN VALUE</h4><blockquote>If<i>sleep()</i>returns because the requested time has elapsed, the value returned will be0.  If<i>sleep()</i>returns because of premature arousal due to delivery of a signal, the returnvalue will be the &quot;unslept&quot; amount (the requested time minus the timeactually slept) in seconds.</blockquote><h4><a name = "tag_000_008_799">&nbsp;</a>ERRORS</h4><blockquote>No errors are defined.</blockquote><h4><a name = "tag_000_008_800">&nbsp;</a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_801">&nbsp;</a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_802">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_803">&nbsp;</a>SEE ALSO</h4><blockquote><i><a href="alarm.html">alarm()</a></i>,<i><a href="getitimer.html">getitimer()</a></i>,<i><a href="nanosleep.html">nanosleep()</a></i>,<i><a href="pause.html">pause()</a></i>,<i><a href="sigaction.html">sigaction()</a></i>,<i><a href="sigsetjmp.html">sigsetjmp()</a></i>,<i><a href="ualarm.html">ualarm()</a></i>,<i><a href="usleep.html">usleep()</a></i>,<i><a href="unistd.h.html">&lt;unistd.h&gt;</a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from Issue 1 of the SVID.</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 + -