

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is user-defined signal handler?
Signals are software interrupts which sent to a program to indicate that an important event has occurred. A Signal may be handled by following one of two possible handlers:
- A default signal handler
- A user-defined signal handler
User-defined signal handler can override this default action that is called to handle the signal. Signals are handled in different ways. Some signals (such as changing the size of a window) are simply ignored; others (such as an illegal memory access) are handled by terminating the program.
A signal handler function may have any name, but must have return type void and have one int parameter.
Example − we might choose the name sigchld_handler for a signal handler for the SIGCHLD signal (termination of a child process). Then the declaration would be −
void sigchld_handler(int sig);
The parameter passed to signal handler is the number of the signal. A programmer may use the same signal handler function to handle several signals.
- Related Questions & Answers
- What is default signal handler?
- What are user-defined exceptions in C#?
- PHP User-defined functions
- What are user defined data types in C#?
- User-Defined Exceptions in Python
- User Defined Literals in C++
- User-defined Custom Exception in C#
- User defined bridge on Docker network
- Using User-Defined Variables in MySQL
- What is Signal to Noise Ratio?
- What is a Unit Parabolic Signal?
- What is a Unit Step Signal?
- What is a Unit Ramp Signal?
- User-defined Exceptions in C# with Example
- User-defined Exceptions in Python with Examples