alarm.html
来自「unix 下的C开发手册,还用详细的例程。」· HTML 代码 · 共 98 行
HTML
98 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>alarm</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_001_167"> </a>NAME</h4><blockquote>alarm - schedule an alarm signal</blockquote><h4><a name = "tag_000_001_168"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="unistd.h.html">unistd.h</a>>unsigned int alarm(unsigned int <i>seconds</i>);</code></pre></blockquote><h4><a name = "tag_000_001_169"> </a>DESCRIPTION</h4><blockquote>The<i>alarm()</i>function causes the system to generate a SIGALRM signal for the process after the number of real-time seconds specified by<i>seconds</i>have elapsed.Processor scheduling delays may prevent the process from handling thesignal as soon as it is generated.<p>If<i>seconds</i>is 0, a pending alarm request, if any, is cancelled.<p>Alarm requests are not stacked; only one SIGALRM generation can bescheduled in this manner; if the SIGALRM signal has not yet beengenerated, the call will result in rescheduling the time at whichthe SIGALRM signal will be generated.<p>Interactions between<i>alarm()</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_001_170"> </a>RETURN VALUE</h4><blockquote>If there is a previous<i>alarm()</i>request with time remaining,<i>alarm()</i>returns a non-zero value that is the number of secondsuntil the previous request would have generated a SIGALRM signal.Otherwise,<i>alarm()</i>returns 0.</blockquote><h4><a name = "tag_000_001_171"> </a>ERRORS</h4><blockquote>The<i>alarm()</i>function is always successful, and no return value is reserved toindicate an error.</blockquote><h4><a name = "tag_000_001_172"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_001_173"> </a>APPLICATION USAGE</h4><blockquote>The<i><a href="fork.html">fork()</a></i>function clears pending alarms in the child process.A new process image created by one of the<i>exec</i>functions inherits the time left to an alarm signal in the oldprocess' image.</blockquote><h4><a name = "tag_000_001_174"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_001_175"> </a>SEE ALSO</h4><blockquote><i><a href="exec.html">exec</a></i>,<i><a href="fork.html">fork()</a></i>,<i><a href="getitimer.html">getitimer()</a></i>,<i><a href="pause.html">pause()</a></i>,<i><a href="sigaction.html">sigaction()</a></i>,<i><a href="ualarm.html">ualarm()</a></i>,<i><a href="usleep.html">usleep()</a></i>,<i><a href="signal.h.html"><signal.h></a></i>,<i><a href="unistd.h.html"><unistd.h></a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from Issue 1 of the SVID.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 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 + =
减小字号Ctrl + -
显示快捷键?