1 .\" Copyright (c) 1996 The NetBSD Foundation, Inc.
2 .\" All rights reserved.
4 .\" This code is derived from software contributed to The NetBSD Foundation
5 .\" by Paul Kranenburg.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
20 .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 .\" POSSIBILITY OF SUCH DAMAGE.
28 .\" $NetBSD: psignal.9,v 1.1 1996/06/22 22:57:35 pk Exp $
39 .Nd post signal to a thread, process, or process group
44 .Fn psignal "struct proc *p" "int signum"
46 .Fn pgsignal "struct pgrp *pgrp" "int signum" "int checkctty"
48 .Fn gsignal "int pgid" "int signum"
50 .Fn tdsignal "struct thread *td" "int signum"
52 These functions post a signal to a thread or one or more processes.
55 common to all three functions should be in the range
60 function posts signal number
62 to the process represented by the process structure
64 With a few exceptions noted below, the target process signal disposition is
65 updated and is marked as runnable, so further handling of the signal is done
66 in the context of the target process after a context switch.
69 does not by itself cause a context switch to happen.
71 The target process is not marked as runnable in the following cases:
72 .Bl -bullet -offset indent
74 The target process is sleeping uninterruptibly.
76 noticed when the process returns from the system call or trap.
78 The target process is currently ignoring the signal.
80 If a stop signal is sent to a sleeping process that takes the
84 the process is stopped without awakening it.
87 restarts a stopped process
88 (or puts them back to sleep)
89 regardless of the signal action
90 (e.g., blocked or ignored).
93 If the target process is being traced
95 behaves as if the target process were taking the default action for
97 This allows the tracing process to be notified of the signal.
101 function posts signal number
103 to each member of the process group described by
107 is non-zero, the signal will be posted only to processes that have
108 a controlling terminal.
110 is implemented by walking along the process list headed by the field
112 of the process group structure
126 function posts signal number
128 to each member of the process group identified by the group id
131 first finds the group structure associated with
140 is zero no action is taken.
144 function posts signal number
146 to the thread represented by the thread structure