- Defined signals
Just a signal flag information, and not to carry large amounts of data, the process will receive a signal from the kernel, and in accordance with the agreed implementation of a code body (response signal), and then continue with the other code, in fact, this way, a signal soft interrupt
Strictly speaking, the process A to the process B can not directly send a signal, but with the core transmission completion signal, the same process B are processed by the kernel of the signals is completed
- Four Elements signal
- Numbering
- name
- event
- The default handling
linux kill -l shows all the signals more commonly 1-31 wherein
Output:
- Way signal generated
- Key generating ctrl + z, ctrl + \, ctrl + s
- System call generates kill raise abort
- Software condition occurs alarm (timer)
- Abnormal production: for example a segmentation fault (illegal memory access), in addition to 0, the memory of their error (bus error)
- Generated kill command
- Signal classification:
- Term termination (e.g.: SIGHUP)
- Pause Stop
- Core generate documentation process dies of reasons (for example: SIGSEGV)
- Ign ignore signals
- Resumes Cont
- State of the signal: Hands up (delivery and arrival) or pending (temporarily blocked due to termination)
- Ignored and allowed to capture the signal SIGKILL SIGSTOP ---- For example, a virus program, you must kill its process. Prior to this, the virus may become the other signals are ignored or catch!
- PCB contains pending signal set signal and the mask character (a blocking signal sets)
Pending signal set and sets the blocking signals from the organization point of view is a set of signals, we may wish to 1-32 marks each different signal types to press the button ctrl + c, for example, if you press the button will 2 transmission signal, the two signals may undergo changes as follows:
Before execution:
Pending signal set signal 2, state 0 ---- that is, is in a "must" state ---- (double negative equals certainly false pending ---- is already decided)
Press the button:
2 pending signal set signal, a state (but if the blocking signal is identified as a focus signal, the signal pending signal 2 remains focused state 1)
Target process after receiving the signal:
2 pending signal set signal, and becomes 0 transited
This process of change has a very elegant word, called flip
- Handling signals
- Performs the default action
- Ignore (discard)
- Capture (user handler)