Unix Signal - Sending Signals

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:

    The harvest truly is plenteous, but the labourers are few.
    Bible: New Testament Jesus, in Matthew, 9:37.

    Jesus, on the lack of proselytizers to the multitude, before sending out his apostles endowed with healing powers. Also in Luke 10:2, “The harvest truly is great ......”

    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)