| <html lang="en"> |
| <head> |
| <title>raise - Untitled</title> |
| <meta http-equiv="Content-Type" content="text/html"> |
| <meta name="description" content="Untitled"> |
| <meta name="generator" content="makeinfo 4.13"> |
| <link title="Top" rel="start" href="index.html#Top"> |
| <link rel="up" href="Signals.html#Signals" title="Signals"> |
| <link rel="prev" href="psignal.html#psignal" title="psignal"> |
| <link rel="next" href="signal.html#signal" title="signal"> |
| <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> |
| <meta http-equiv="Content-Style-Type" content="text/css"> |
| <style type="text/css"><!-- |
| pre.display { font-family:inherit } |
| pre.format { font-family:inherit } |
| pre.smalldisplay { font-family:inherit; font-size:smaller } |
| pre.smallformat { font-family:inherit; font-size:smaller } |
| pre.smallexample { font-size:smaller } |
| pre.smalllisp { font-size:smaller } |
| span.sc { font-variant:small-caps } |
| span.roman { font-family:serif; font-weight:normal; } |
| span.sansserif { font-family:sans-serif; font-weight:normal; } |
| --></style> |
| </head> |
| <body> |
| <div class="node"> |
| <a name="raise"></a> |
| <p> |
| Next: <a rel="next" accesskey="n" href="signal.html#signal">signal</a>, |
| Previous: <a rel="previous" accesskey="p" href="psignal.html#psignal">psignal</a>, |
| Up: <a rel="up" accesskey="u" href="Signals.html#Signals">Signals</a> |
| <hr> |
| </div> |
| |
| <h3 class="section">7.2 <code>raise</code>—send a signal</h3> |
| |
| <p><a name="index-raise-424"></a><a name="index-g_t_005fraise_005fr-425"></a><strong>Synopsis</strong> |
| <pre class="example"> #include <signal.h> |
| int raise(int <var>sig</var>); |
| |
| int _raise_r(void *<var>reent</var>, int <var>sig</var>); |
| |
| </pre> |
| <p><strong>Description</strong><br> |
| Send the signal <var>sig</var> (one of the macros from `<code>sys/signal.h</code>'). |
| This interrupts your program's normal flow of execution, and allows a signal |
| handler (if you've defined one, using <code>signal</code>) to take control. |
| |
| <p>The alternate function <code>_raise_r</code> is a reentrant version. The extra |
| argument <var>reent</var> is a pointer to a reentrancy structure. |
| |
| <p><br> |
| <strong>Returns</strong><br> |
| The result is <code>0</code> if <var>sig</var> was successfully raised, <code>1</code> |
| otherwise. However, the return value (since it depends on the normal |
| flow of execution) may not be visible, unless the signal handler for |
| <var>sig</var> terminates with a <code>return</code> or unless <code>SIG_IGN</code> is in |
| effect for this signal. |
| |
| <p><br> |
| <strong>Portability</strong><br> |
| ANSI C requires <code>raise</code>, but allows the full set of signal numbers |
| to vary from one implementation to another. |
| |
| <p>Required OS subroutines: <code>getpid</code>, <code>kill</code>. |
| |
| <p><br> |
| |
| </body></html> |
| |