SVR5 and SCO OpenServer 5


M_SIG, M_PCSIG -- post a signal to a process


The M_SIG message type is sent upstream by modules or drivers to post a signal to a process. When the message reaches the Stream head, the first data byte of the message is transformed into a signal (as defined in sys/signal.h) to the process(es) according to the following:

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.

Message type

The M_SIG message type is ordinary (non-priority); the M_PCSIG message type is priority.

Version applicability

ddi: 1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp
oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp

Differences between versions

Note that, on SCO OpenServer 5, a Stream becomes the controlling tty for its process group if, on open, a module or driver sets u.u_ttyp to point to a (short) process group value.


proc_signal(D3), streamio

``Signals'' in Programming with system calls and libraries

19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005