Chapter 5: Locking and Interprocess Communication
information on the implementation structure, I willnot discuss specific cases but restrict myself to a
description of the key mechanisms.
Table 5-3: Some System Calls Relating to Signals
System call Function
kill Sends a signal to all processes of a process group.
tkill Sends a signal to a single process.
sigpending Checks whether there are pending signals.
sigprocmask Manipulates a bitmask of blocked signals.
sigsuspend Sleeps until a specific signal is received.
Sending Signals
Despite their names,killandtkillsend any signal to a process group or to a single process, respec-
tively. As both functions are basically identical,^14 I discuss onlysys_tkill, whose code flow diagram is
shown in Figure 5-9.
sys_tkill
Cancel processing
do_tkill
find_task_by_vpid
check_kill_permission
specific_send_sig_info
sig_ignored?
send_signal
signal_wake_up
Figure 5-9: Code flow diagram forsys_tkill.
(^14) sys_killsends the signal to several processes that are interpreted according to the form of the PID passed.
❑ pid> 0 sends the signal to the process with the specified PID.
❑ pid= 0 sends the signal to all members of the process group of the task that sent the signal.
❑ pid=− 1 sends the signal to all processes withpid> 1.
❑ pid=−pgrp<− 1 sends the signal to all members of thepgrpprocess group.