CS 3733 Operating Systems
Lecture 24 [3/9/98]: Signals
Reading: Sections 5.1-5.2 of PUP
Brief look at socket implementation of UICI
Look at how signals come in to the UICI implementation.
Basic terminology
- Signal - software notification of an event.
- Lifetime of a signal - time between generation and delivery
- Delivery of a signal - takes place when process takes action on
signal.
- A pending signal has been generated but not yet delivered.
- Signal handler - function executed when is delivered.
- Signal mask - list of currently blocked signals for a process.
- A blocked signal - is a signal that
is prevented from being delivered to a process.
- Signal set - a list of signals used in various signal operations.
Sending a signal
- Signals are specified by integers.
symbol.h contains
their symbolic names.
-
kill sends specified signal to a process or a group of processes.
-
raise sends specified signal to self.
- Certain keystrokes cause the keyboard device driver to generate
a signal which is sent to the foreground process group:
-
INTR (ctrl-c) generates SIGINT
-
QUIT (ctrl-|) generates SIGQUIT
-
SUSP (ctrl-z) generates SIGSTOP
-
DSUSP (ctrl-y) generates SIGCONT
-
alarm sends a SIGALRM to caller.
Signal masks and signal sets:
- Signal mask is associated with blocking of signals. These
signals are not lost---their delivery is just postponed.
- Signal set operations:
sigemptyset, sigfillset,
sigaddset, sigdelset, sigismember - Signal mask operations are performed by calling
sigprocmask
with SIG_BLOCK, SIG_UNBLOCK
and SIG_SETMASK.
Skill: Understand the basics of signals
Revision Date: 3/9/98