1<html lang="en"> 2<head> 3<title>raise - Untitled</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="Untitled"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="Signals.html#Signals" title="Signals"> 9<link rel="prev" href="psignal.html#psignal" title="psignal"> 10<link rel="next" href="signal.html#signal" title="signal"> 11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 12<meta http-equiv="Content-Style-Type" content="text/css"> 13<style type="text/css"><!-- 14 pre.display { font-family:inherit } 15 pre.format { font-family:inherit } 16 pre.smalldisplay { font-family:inherit; font-size:smaller } 17 pre.smallformat { font-family:inherit; font-size:smaller } 18 pre.smallexample { font-size:smaller } 19 pre.smalllisp { font-size:smaller } 20 span.sc { font-variant:small-caps } 21 span.roman { font-family:serif; font-weight:normal; } 22 span.sansserif { font-family:sans-serif; font-weight:normal; } 23--></style> 24<link rel="stylesheet" type="text/css" href="../cs.css"> 25</head> 26<body> 27<div class="node"> 28<a name="raise"></a> 29<p> 30Next: <a rel="next" accesskey="n" href="signal.html#signal">signal</a>, 31Previous: <a rel="previous" accesskey="p" href="psignal.html#psignal">psignal</a>, 32Up: <a rel="up" accesskey="u" href="Signals.html#Signals">Signals</a> 33<hr> 34</div> 35 36<h3 class="section">7.2 <code>raise</code>—send a signal</h3> 37 38<p><a name="index-raise-424"></a><a name="index-g_t_005fraise_005fr-425"></a><strong>Synopsis</strong> 39<pre class="example"> #include <signal.h> 40 int raise(int <var>sig</var>); 41 42 int _raise_r(void *<var>reent</var>, int <var>sig</var>); 43 44</pre> 45 <p><strong>Description</strong><br> 46Send the signal <var>sig</var> (one of the macros from `<code>sys/signal.h</code>'). 47This interrupts your program's normal flow of execution, and allows a signal 48handler (if you've defined one, using <code>signal</code>) to take control. 49 50 <p>The alternate function <code>_raise_r</code> is a reentrant version. The extra 51argument <var>reent</var> is a pointer to a reentrancy structure. 52 53 <p><br> 54<strong>Returns</strong><br> 55The result is <code>0</code> if <var>sig</var> was successfully raised, <code>1</code> 56otherwise. However, the return value (since it depends on the normal 57flow of execution) may not be visible, unless the signal handler for 58<var>sig</var> terminates with a <code>return</code> or unless <code>SIG_IGN</code> is in 59effect for this signal. 60 61 <p><br> 62<strong>Portability</strong><br> 63ANSI C requires <code>raise</code>, but allows the full set of signal numbers 64to vary from one implementation to another. 65 66 <p>Required OS subroutines: <code>getpid</code>, <code>kill</code>. 67 68 <p><br> 69 70 </body></html> 71 72