From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/c/program%2Fraise.html | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 devdocs/c/program%2Fraise.html (limited to 'devdocs/c/program%2Fraise.html') diff --git a/devdocs/c/program%2Fraise.html b/devdocs/c/program%2Fraise.html new file mode 100644 index 00000000..5aa1e9e2 --- /dev/null +++ b/devdocs/c/program%2Fraise.html @@ -0,0 +1,43 @@ +

raise

Defined in header <signal.h>
int raise( int sig );
+

Sends signal sig to the program. The signal handler, specified using signal(), is invoked.

+

If the user-defined signal handling strategy is not set using signal() yet, it is implementation-defined whether the signal will be ignored or default handler will be invoked.

+

Parameters

+ +
sig - the signal to be sent. It can be an implementation-defined value or one of the following values: +
defines signal types
(macro constant)

Return value

​0​ upon success, non-zero value on failure.

+

Example

#include <signal.h>
+#include <stdio.h>
+ 
+void signal_handler(int signal)
+{
+    printf("Received signal %d\n", signal);
+}
+ 
+int main(void)
+{
+    // Install a signal handler.
+    signal(SIGTERM, signal_handler);
+ 
+    printf("Sending signal %d\n", SIGTERM);
+    raise(SIGTERM);
+    printf("Exit main()\n");
+}

Output:

+
Sending signal 15
+Received signal 15
+Exit main()

References

See also

+ +
sets a signal handler for particular signal
(function)
C++ documentation for raise
+

+ © cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
+ https://en.cppreference.com/w/c/program/raise +

+
-- cgit v1.2.3