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.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.