Lab3-Signal

Lab3-Signal - Lab 3 Signal handling in Unix/Linux Before...

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

View Full Document Right Arrow Icon
Lab 3 Signal handling in Unix/Linux
Background image of page 1

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

View Full DocumentRight Arrow Icon
Before You Start… Login to Linux Boot the PC, and select the option: SLIM/SWIM Choose 5 Ubuntu 10.04 Login the system using CS account info Download lab3.tgz from course webpage to Desktop Then, in a terminal cd ~/Desktop tar xzvf lab3.tgz cd lab3 make When you see Try these command(s) in your terminal TRY!
Background image of page 2
Useful Reference The GNU C Library http://www.gnu.org/software/libc/manual/html_node/Signal- Handling.html#Signal-Handling
Background image of page 3

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

View Full DocumentRight Arrow Icon
IPC Signals (Recap) Signal handling When a signal occurs, the OS determines which process should receive signal and how the process will respond Each signal is represented by a value/symbolic name SIGINT: value = 2, generated when Ctrl-c is pressed SIGCHLD: value = 17, generated when child process finishes execution or is terminated Processes may catch, ignore or mask a signal Catching a signal involves specifying a routine (signal handler) that the OS will invoke when the process receives that signal , e.g., the signal() or sigaction() system call Using OS's default action to handle the signal Masking a signal is to instruct the OS not to deliver signals of that type until the process clears the signal mask SIGKILL and SIGSTP cannot be caught, blocked or ignored
Background image of page 4
IPC Signals Process of Signal Handling Program Signal Happens Signal Handle Synchronous Signal Signal Arrive Signal Handle Asynchronous Signal
Background image of page 5

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

View Full DocumentRight Arrow Icon
signal() - Set new signal handler Used to set a new signal handler for the signal with number signum
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 15

Lab3-Signal - Lab 3 Signal handling in Unix/Linux Before...

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

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