[net.unix-wizards] Idiosyncratic signal use

brett@wjvax.UUCP (04/22/86)

We have an application in which I wish to signal from home-grown device drivers
that there is an "urgent condition" present on the file.  We have two
different devices that need to be able to do this.  The first is a gpib card
(gpib is an instrument bus) that must signal whoever has it opened when a
service request is generated by an instrument on the gpib bus.  The second
device is a parallel card that must signal its current owner when a sense
line goes high.

The question is ... how do I signal this?  The obvious choice is to use
a (Berkeley) signal -- but which one?  I see three choices.  The first is
to use an unused signal (i.e. signal 29, 30, or 31).  The second is to
preempt a signal for my own use.  The third is to use SIGURG.  I strongly
incline toward the latter.  In all cases, my signal handler would
query each device that COULD have an urgent condition, and handle it if it
did.

Sigvec(2) describes SIGURG as ...

	"urgent condition present on socket"

However, fcntl(2) describes a command F_SETOWN that describes the "owner" of
the file for the purpose of receiving SIGIO and SIGURG signals.  This seems
to imply that SIGURG was intended to apply more generally than just to
sockets.

Is using SIGURG correct?  If so, any pointers on how to access from the
device driver the file owner, as set via F_SETOWN in fcntl(2), would be
appreciated.  We do not have a source license, but we can reconfigure the
kernel in order to add device drivers.

In addition, the select(2) call describes three file descriptor bit
masks -- read, write, and exceptional condition.  How does the
exceptional condition mask relate to the use of SIGURG?  When a file
descriptor comes urgent, should I mark the exceptional condition mask in
some way in addition to sending SIGURG.  If so, how?

Answers to any or all of the above questions would be appreciated, over
electronic mail.  I will try to summarize to the net.  Thanks in advance.

-------------
Brett Galloway
{pesnta,twg,ios,qubix,turtlevax,tymix,vecpyr,certes,isi}!wjvax!brett