Saturday, August 4, 2018

Notes on Signals in UNIX

  • Pressing a key generates an interrupt and kernel has a keyboard interrupt handler module. The KB interrupt handler would send a signal to all processes associated with the terminal.
  • Once a signal handler is called, it is deleted from memory. So we call it recursively.
    void handler()
    {
        signal(SIGINT, handler);
    }
  • Common Signals to know:
    • SIGSYS: Incorrect usage of a system call
    • SIGCHLD
    • SIGALRM
  • SIGALRM is also used in sleep() call. Sleep call is just waiting infinitely for a signal. To create such wait, pause() function is used.

Written with StackEdit.

No comments:

Post a Comment