10-Signals_II_2spp

10-Signals_II_2spp - Lecture X Signals-II Tevfik Ko!ar...

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

View Full Document Right Arrow Icon
1 Tevfik Ko ! ar Louisiana State University October 5th, 2010 Lecture - X Signals -II Signals from a Process #include <signal.h> int kill(pid_t pid, int sig); If pid > 0: Sig is sent to the process with pid If pid = 0: Sig is sent to all processes whose group ID is equal to the process group ID of the sender If pid = -1: If root , sig is sent to all processes excluding system processes If not root , sig is sent to all processes with the same uid as the user, excluding the sender. sig=0; error checking, i.e. validity of pid 2
Background image of page 1

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

View Full DocumentRight Arrow Icon
Signal Semantics 3 Implementation 4
Background image of page 2
Receiving Signals 5 Overlapping Signals • SIGY interrupts SIGX ex: phone then door When you press CTRL-C then CTRL-\, the program first jumps to inthandler, then to quithandler, then back to inthandler, then back to main loop. • SIGX interrupts SIGX ex: two people coming to your door Three ways this can be handled: 1.Recursively call the same handler 2.Ignore the second signal, like a phone without call waiting 3.Block the second signal until done handling the first Method 3 is safest and default in modern systems Interrupted System Calls receiving a signal while waiting for input 6
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/23/2011 for the course CSC 4303 taught by Professor Staff during the Fall '10 term at LSU.

Page1 / 12

10-Signals_II_2spp - Lecture X Signals-II Tevfik Ko!ar...

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

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