Sending Signals
- Typing certain key combinations at the controlling terminal of a running process causes the system to send it certain signals:
- Ctrl-C (in older Unixes, DEL) sends an INT signal (SIGINT); by default, this causes the process to terminate.
- Ctrl-Z sends a TSTP signal (SIGTSTP); by default, this causes the process to suspend execution.
- Ctrl-\ sends a QUIT signal (SIGQUIT); by default, this causes the process to terminate and dump core.
- (Those default key combinations can be changed with the stty command.)
- The kill(2) system call will send the specified signal to the process, if permissions allow. Similarly, the kill(1) command allows a user to send signals to processes. The
raise(3)
library function sends the specified signal to the current process. - Exceptions such as division by zero or a segmentation violation will generate signals (here, SIGFPE and SIGSEGV respectively, which both by default cause a core dump and a program exit).
- The kernel can generate a signal to notify the process of an event. For example, SIGPIPE will be generated when a process writes to a pipe which has been closed by the reader; by default, this causes the process to terminate, which is convenient when constructing shell pipelines.
Read more about this topic: Unix Signal
Famous quotes containing the words sending and/or signals:
“I have heard arguments ... in favor of pardoning D. M. Bennett, convicted of sending obscene matter through the mails, viz., a pamphlet [by Ezra Hervey Heywood] of a polemical character in favor of free love. While I am satisfied that Bennett ought not to have been convicted, I am not satisfied that I ought to undertake to correct the mistakes of the courtsconstantly persisted inby the exercise of the pardoning power.”
—Rutherford Birchard Hayes (18221893)
“The term preschooler signals another change in our expectations of children. While toddler refers to physical development, preschooler refers to a social and intellectual activity: going to school. That shift in emphasis is tremendously important, for it is at this age that we think of children as social creatures who can begin to solve problems.”
—Lawrence Kutner (20th century)