Fast review mode: answers are shown by default so you can skim quickly. Hide them if you want to self-test.
In Linux, a signal is a notification or message that the operating system or another application sends to a program. Signals are assigned numbers between 1 and 31, and are usually self-explanatory. For example, signal number 9, or SIGKILL, informs the program that it is being attempting to be killed.
When a process receives a signal, it stops execution and handles the signal. The behavior depends on the signal. For example, SIGINT terminates the process.
Here are some default actions for signals: SIGHUP, SIGINT, SIGKILL: Kills the process SIGQUIT: Kills the process and forces a core dump SIGSTOP, SIGTTIN: Stops the process SIGCONT: Continues a stopped process SIGCHLD: Is ignored
You can set up a handler for the signal using the signal system call. You can also block signals, which means that when a signal is blocked, it is not delivered but remains pending. Signals are often described as software interrupts, but they aren't actually asynchronous. When a signal is sent to a process, the kernel adds it to the process' pending signal set.
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.