summaryrefslogtreecommitdiff
path: root/devdocs/c/program%2Fsig_err.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/c/program%2Fsig_err.html')
-rw-r--r--devdocs/c/program%2Fsig_err.html49
1 files changed, 0 insertions, 49 deletions
diff --git a/devdocs/c/program%2Fsig_err.html b/devdocs/c/program%2Fsig_err.html
deleted file mode 100644
index 5e2118d6..00000000
--- a/devdocs/c/program%2Fsig_err.html
+++ /dev/null
@@ -1,49 +0,0 @@
- <h1 id="firstHeading" class="firstHeading">SIG_ERR</h1> <table class="t-dcl-begin"> <tr class="t-dsc-header"> <th> Defined in header <code>&lt;signal.h&gt;</code> </th> <th> </th> <th> </th> </tr> <tr class="t-dcl"> <td class="t-dcl-nopad"> <pre data-language="c">#define SIG_ERR /* implementation defined */</pre>
-</td> <td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> </table> <p>A value of type <code>void (*)(int)</code>. When returned by <code><a href="signal" title="c/program/signal">signal</a></code>, indicates that an error has occurred.</p>
-<h3 id="Example"> Example</h3> <div class="t-example"> <div class="c source-c"><pre data-language="c">#include &lt;stdio.h&gt;
-#include &lt;stdlib.h&gt;
-#include &lt;signal.h&gt;
-
-void signal_handler(int sig)
-{
- printf("Received signal: %d\n", sig);
-}
-
-int main(void)
-{
- /* Install a signal handler. */
- if (signal(SIGTERM, signal_handler) == SIG_ERR)
- {
- printf("Error while installing a signal handler.\n");
- exit(EXIT_FAILURE);
- }
-
- printf("Sending signal: %d\n", SIGTERM);
- if (raise(SIGTERM) != 0)
- {
- printf("Error while raising the SIGTERM signal.\n");
- exit(EXIT_FAILURE);
- }
-
- printf("Exit main()\n");
- return EXIT_SUCCESS;
-}</pre></div> <p>Output:</p>
-<div class="text source-text"><pre data-language="c">Sending signal: 15
-Received signal: 15
-Exit main()</pre></div> </div> <h3 id="References"> References</h3> <ul>
-<li> C17 standard (ISO/IEC 9899:2018): </li>
-<ul><li> 7.14/3 Signal handling &lt;signal.h&gt; (p: 194) </li></ul>
-<li> C11 standard (ISO/IEC 9899:2011): </li>
-<ul><li> 7.14/3 Signal handling &lt;signal.h&gt; (p: 265) </li></ul>
-<li> C99 standard (ISO/IEC 9899:1999): </li>
-<ul><li> 7.14/3 Signal handling &lt;signal.h&gt; (p: 246) </li></ul>
-<li> C89/C90 standard (ISO/IEC 9899:1990): </li>
-<ul><li> 4.7 SIGNAL HANDLING &lt;signal.h&gt; </li></ul>
-</ul> <h3 id="See_also"> See also</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td> <div><a href="signal" title="c/program/signal"> <span class="t-lines"><span>signal</span></span></a></div> </td> <td> sets a signal handler for particular signal <br> <span class="t-mark">(function)</span> </td>
-</tr> <tr class="t-dsc"> <td colspan="2"> <span><a href="https://en.cppreference.com/w/cpp/utility/program/SIG_ERR" title="cpp/utility/program/SIG ERR">C++ documentation</a></span> for <code>SIG_ERR</code> </td>
-</tr> </table> <div class="_attribution">
- <p class="_attribution-p">
- &copy; cppreference.com<br>Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.<br>
- <a href="https://en.cppreference.com/w/c/program/SIG_ERR" class="_attribution-link">https://en.cppreference.com/w/c/program/SIG_ERR</a>
- </p>
-</div>