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

📄 siglib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<p>The following values are defined in <b>signal.h</b> for <b>si_code</b>:<dl><dt><b>SI_USER</b><dd>the signal was sent by the <b><a href="./sigLib.html#kill">kill</a>(&nbsp;)</b> function.<dt><b>SI_QUEUE</b><dd>the signal was sent by the <b><a href="./sigLib.html#sigqueue">sigqueue</a>(&nbsp;)</b> function.<dt><b>SI_TIMER</b><dd>the signal was generated by the expiration of a timer set by <b><a href="./timerLib.html#timer_settime">timer_settime</a>(&nbsp;)</b>.<dt><b>SI_ASYNCIO</b><dd>the signal was generated by the completion of an asynchronous I/O request.<dt><b>SI_MESGQ</b><dd>the signal was generated by the arrival of a message on an empty messagequeue.</dl><p>The function <b><a href="./sigLib.html#sigtimedwait">sigtimedwait</a>(&nbsp;)</b> provides a synchronous mechanism for tasksto wait for asynchromously generated signals.  A task should use<b><a href="./sigLib.html#sigprocmask">sigprocmask</a>(&nbsp;)</b> to block any signals it wants to handle synchronously andleave their signal handlers in the default state.  The task can thenmake repeated calls to <b><a href="./sigLib.html#sigtimedwait">sigtimedwait</a>(&nbsp;)</b> to remove any signals that aresent to it.<p></blockquote><h4>RETURNS</h4><blockquote><p>Upon successful completion (that is, one of the signals specifiedby <i>pSet</i> is pending or is generated) <b><a href="./sigLib.html#sigtimedwait">sigtimedwait</a>(&nbsp;)</b> will return the selectedsignal number.  Otherwise, a value of -1 is returned and <b>errno</b> is set toindicate the error.<p></blockquote><h4>ERRNO</h4><blockquote><p><dl><dt>EINTR<dd>The wait was interrupted by an unblocked, caught signal.<dt>EAGAIN<dd>No signal specified by <i>pSet</i> was delivered within the specified timeoutperiod.<dt>EINVAL<dd>The <i>pTimeout</i> argument specified a <b>tv_nsec</b> value less than zero or greaterthan or equal to 1000 million.</dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./sigLib.html#top">sigLib</a></b>, <b><a href="./sigLib.html#sigwait">sigwait</a>(&nbsp;)</b><hr><a name="sigwaitinfo"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>sigwaitinfo(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>sigwaitinfo(&nbsp;)</strong> - wait for real-time signals</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int sigwaitinfo    (    const sigset_t * pSet,    /* the signal mask while suspended */    struct siginfo * pInfo    /* return value */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>The function <b><a href="./sigLib.html#sigwaitinfo">sigwaitinfo</a>(&nbsp;)</b> is equivalent to calling <b><a href="./sigLib.html#sigtimedwait">sigtimedwait</a>(&nbsp;)</b> with<i>pTimeout</i> equal to NULL.  See that manual entry for more information.<p></blockquote><h4>RETURNS</h4><blockquote><p>Upon successful completion (that is, one of the signals specifiedby <i>pSet</i> is pending or is generated) <b><a href="./sigLib.html#sigwaitinfo">sigwaitinfo</a>(&nbsp;)</b> returns the selectedsignal number.  Otherwise, a value of -1 is returned and <b>errno</b> is set toindicate the error.<p></blockquote><h4>ERRNO</h4><blockquote><p><dl><dt>EINTR<dd>The wait was interrupted by an unblocked, caught signal.</dl></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./sigLib.html#top">sigLib</a></b><hr><a name="sigwait"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>sigwait(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>sigwait(&nbsp;)</strong> - wait for a signal to be delivered (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int sigwait    (    const sigset_t * pSet,    int *            pSig    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine waits until one of the signals specified in <i>pSet</i> is deliveredto the calling thread. It then stores the number of the signal received inthe the location pointed to by <i>pSig</i>.<p>The signals in <i>pSet</i> must not be ignored on entrance to <b><a href="./sigLib.html#sigwait">sigwait</a>(&nbsp;)</b>.If the delivered signal has a signal handler function attached, thatfunction is not called.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR on failure.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./sigLib.html#top">sigLib</a></b>, <b><a href="./sigLib.html#sigtimedwait">sigtimedwait</a>(&nbsp;)</b><hr><a name="sigvec"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>sigvec(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>sigvec(&nbsp;)</strong> - install a signal handler</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int sigvec    (    int                   sig,  /* signal to attach handler to */    const struct sigvec * pVec, /* new handler information */    struct sigvec *       pOvec /* previous handler information */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine binds a signal handler routine referenced by <i>pVec</i> to aspecified signal <i>sig</i>.  It can also be used to determine which handler,if any, has been bound to a particular signal:  <b><a href="./sigLib.html#sigvec">sigvec</a>(&nbsp;)</b> copies currentsignal handler information for <i>sig</i> to <i>pOvec</i> and does not install asignal handler if <i>pVec</i> is set to NULL (0).<p>Both <i>pVec</i> and <i>pOvec</i> are pointers to a structure of type <b>structsigvec</b>.  The information passed includes not only the signal handlerroutine, but also the signal mask and additional option bits.  Thestructure <b>sigvec</b> and the available options are defined in <b>signal.h</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK (0), or ERROR (-1) if the signal number is invalid or thesignal TCB cannot be allocated.<p></blockquote><h4>ERRNO</h4><blockquote><p>EINVAL, ENOMEM</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./sigLib.html#top">sigLib</a></b><hr><a name="sigsetmask"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>sigsetmask(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>sigsetmask(&nbsp;)</strong> - set the signal mask</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int sigsetmask    (    int mask                  /* new signal mask */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets the calling task's signal mask to a specified value.A one (1) in the bit mask indicates that the specified signal is blockedfrom delivery.  Use the macro SIGMASK to construct the mask for a specifiedsignal number.<p></blockquote><h4>RETURNS</h4><blockquote><p>The previous value of the signal mask.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./sigLib.html#top">sigLib</a></b>, <b><a href="./sigLib.html#sigprocmask">sigprocmask</a>(&nbsp;)</b><hr><a name="sigblock"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>sigblock(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>sigblock(&nbsp;)</strong> - add to a set of blocked signals</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int sigblock    (    int mask                  /* mask of additional signals to be blocked */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds the signals in <i>mask</i> to the task's set of blocked signals.A one (1) in the bit mask indicates that the specified signal is blockedfrom delivery.  Use the macro SIGMASK to construct the mask for a specifiedsignal number.<p></blockquote><h4>RETURNS</h4><blockquote><p>The previous value of the signal mask.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./sigLib.html#top">sigLib</a></b>, <b><a href="./sigLib.html#sigprocmask">sigprocmask</a>(&nbsp;)</b><hr><a name="raise"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>raise(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>raise(&nbsp;)</strong> - send a signal to the caller's task</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int raise    (    int signo                 /* signal to send to caller's task */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sends the signal <i>signo</i> to the task invoking the call.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK (0), or ERROR (-1) if the signal number or task ID is invalid.<p></blockquote><h4>ERRNO</h4><blockquote><p>EINVAL</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./sigLib.html#top">sigLib</a></b><hr><a name="kill"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>kill(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>kill(&nbsp;)</strong> - send a signal to a task (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int kill    (    int tid,                  /* task to send signal to */    int signo                 /* signal to send to task */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sends a signal <i>signo</i> to the task specified by <i>tid</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK (0), or ERROR (-1) if the task ID or signal number is invalid.<p></blockquote><h4>ERRNO</h4><blockquote><p>EINVAL</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./sigLib.html#top">sigLib</a></b><hr><a name="sigqueue"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>sigqueue(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>sigqueue(&nbsp;)</strong> - send a queued signal to a task</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int sigqueue    (    int                tid,    int                signo,    const union sigval value    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>The function <b><a href="./sigLib.html#sigqueue">sigqueue</a>(&nbsp;)</b> sends the signal specified by <i>signo</i> withthe signal-parameter value specified by <i>value</i> to the processspecified by <i>tid</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK (0), or ERROR (-1) if the task ID or signal number is invalid,or if there are no queued-signal buffers available.<p></blockquote><h4>ERRNO</h4><blockquote><p>EINVAL EAGAIN</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./sigLib.html#top">sigLib</a></b></body></html>

⌨️ 快捷键说明

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