csignal header file declared the function raise() to handle a particular signal. Signal learns some unusual behavior in a program, and calls the signal handler. It is implemented to check if the default handler will get called or it will be ignored.
int raise ( int signal_ )
Parameter: The function accepts a single parameter sig which specifies the signal which is artificially raised. It can take any of the 6 C standard signals.
Defined Signal Types
Return Value: It return a nonzero value with no error in signal else it returns zero. The function returns different nonzero elements with different defined signals.
Below programs illustrate the above method:
Before called Signal = 0 After called Signal = 6
Before called Signal = 0 After called Signal = 2
Before called Signal = 0 After called Signal = 15
Before called Signal = 0 After called Signal = 11
Before called Signal = 0 After called Signal = 8
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Function Overloading vs Function Overriding in C++
- How to call function within function in C or C++
- What happens when a virtual function is called inside a non-virtual function in C++
- Difference between Virtual function and Pure virtual function in C++
- fma() function in C++
- log() function in C++
- exp() function C++
- div() function in C++
- arc function in C
- putchar() function in C
- map key_comp() function in C++ STL
- Inline function in C
- bit_and function in C++
- mbsinit() Function in C/C++
- wcsrchr() function in C/C++
- mbrlen() function in C/C++
- mbrtowc() function in C/C++
- strcmpi() function in C
- wctob() function in C++
- wcscoll() function in C++
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.