|
|
If the signal is not SIGPOLL and the Stream containing the sending module or driver is a controlling tty, the signal is sent to the associated process group. A STREAM becomes the controlling tty for its process group if, when the open system call is issued, a module or driver sends an M_SETOPTS(D7str) message to the STREAM head with the SO_ISTTY flag set.
If the signal is SIGPOLL, it is sent only to those processes which have explicitly registered to receive the signal (see I_SETSIG in streamio). If the signal is not SIGPOLL and the STREAM is not a controlling tty, no signal is sent, except for the SIOCSPGRP and TIOCSPGRP ioctls. These two ioctls set the process group member in the STREAM head so the STREAM can generate signals even if it is not a controlling tty.
The M_PCSIG message type is similar to the M_SIG message except for priority. M_PCSIG is often preferable to the M_SIG message, especially in tty applications, because M_SIG may be queued, while M_PCSIG is more guaranteed to get through quickly. For example, if the M_SIG message is generated when the <Del> key is pressed on the terminal and the user has already typed ahead, the M_SIG message becomes queued and the user does not get the call until it is too late; it becomes impossible to kill or interrupt a process by pressing a <Del> key.
STREAMS drivers should never call the proc_signal(D3) function to send a signal to a process, but should instead use these message types.
u.u_ttyp
to point
to a (short) process group value.
``Signals'' in Programming with system calls and libraries