6-on-1 - Lecture Notes 9 Management of Signals Anand...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 3/12/2003 CSci 4061 - Instructor: A. Tripathi 1 Lecture Notes 9 Management of Signals Anand Tripathi CSci 4061 Introduction to Operating Systems 3/12/2003 CSci 4061 - Instructor: A. Tripathi 2 Topics from Chapter 5 Sending signals 5.1 Signal Mask and Signal Sets 5.2 Catching and ignoring signals – sigaction 5.3 Waiting for signals – pause and sigsuspend System calls and signals: 5.6 Signal-safe system calls and library functions setjmp and longjmp – for saving and restoring program execution context 5.7 3/12/2003 CSci 4061 - Instructor: A. Tripathi 3 Signal Facility in Unix It is a application-programming level abstraction of interrupts. A process can interrupt another related process by sending a signal to it. A C program can define handlers for different kinds of signals. A signal handler is a C function. If no handler is defined, the system will take some default action. 3/12/2003 CSci 4061 - Instructor: A. Tripathi 4 Signal Facility in Unix A signal may be sent from one process to another related process, e.g. one in its group. The kernel delivers the signal to the process. The kernel may also generate and deliver a signal for a process when some abnormal condition arises. E.g. Illegal memory reference Illegal operation An application defined timer expires (alarm signal) 3/12/2003 CSci 4061 - Instructor: A. Tripathi 5 Signal Facility in Unix Generated by terminal SIGNAL DELIVERY Generated by kernel Generated by another process Process A Process B 3/12/2003 CSci 4061 - Instructor: A. Tripathi 6 Signal Facility in Unix Kernel Process code 4. Next instr 1. Signal delivery by the kernel User Defined Signal handler 2 3
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 3/12/2003 CSci 4061 - Instructor: A. Tripathi 7 Signal Management A process can manage signals in several ways: Install a handler for a specific handler to take an user-defined action when the signal occurs. Process catches that signal. Instruct the kernel to ignore a specific signal. Instruct the kernel to take a system-defined default action. Mask a signal. Such a signal will be kept pending until the process enables the delivery of the signal when it is willing to accept and handle the signal. Wait for a signal of some type to occur. Send a signal to process or a process-group. 3/12/2003 CSci 4061 - Instructor: A. Tripathi 8 Examples of Signals See /usr/include/sys/iso/signal_iso.h on a Solaris machine Default Action SIGHUP 1 /* hangup */ SIGINT 2 /* interrupt (rubout) CNTRL-C*/ Exit SIGQUIT 3 /* quit (ASCII FS) */ Core dumped SIGILL 4 /* illegal instruction (not reset when caught) */Core dumped SIGTRAP 5 /* trace trap (not reset when caught) */ SIGIOT 6 /* IOT instruction */ SIGABRT 6 /* used by abort, replace SIGIOT in the future */ SIGEMT 7 /* EMT instruction */ SIGFPE 8 /* floating point exception */ SIGKILL 9 /* kill (cannot be caught or ignored) */ SIGBUS 10 /* bus error */ SIGSEGV 11 /* segmentation violation */ SIGSYS
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 10

6-on-1 - Lecture Notes 9 Management of Signals Anand...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online