Checking the phone/Screen

Todd Day todd at ivucsb.sba.ca.us
Sun Jun 25 05:42:15 AEST 1989


In article <25203 at shemp.CS.UCLA.EDU> michael at CS.UCLA.EDU (michael gersten) writes:
~I want the Unix-PC to beep whenever line one rings (for example,
~if I'm using line 2). If I can read the contents of /dev/w2 (the
~phone manager's window), this would be easy; just read it and look
~for "RING".
~ 
~Alternativly, if I could find out when the phone is ringing, without
~interfearing with the current phone manager, then I could do it.

What I had to do was actually modify the kernel (3.50) temporarily
so that I could gain control of SIGPHONE.  It seems that SIGPHONE
only gets sent to the process that opens the phone device first.
Since phone manager is the first to do this, no other process
can get ahold of it.  Basically, my patch to the kernel simply
NOPS the code that checks to see if the phone device is already
open.  Then, the address of my process is set up for the signal.
This removes the signal going to the phone manager, however, so
every time I get the signal, I do a kill(-1, SIGPHONE) so SIGPHONE
gets sent to everyone!  However, since the default for SIGPHONE is
SIGIGN, you don't have to worry.

Why did I have to do the modification in the first place?  Why doesn't
the kernal send SIGPHONE to all processes that want it?  Anyone?

Someday when I finish unpacking all my stuff, I'll bind up my
ringdaemon and send it to the net.

-- 

Todd Day | todd at ivucsb.sba.ca.us | ivucsb!todd at anise.acc.com
"All theory, no practice.  That's the story of my life."



More information about the Comp.sys.att mailing list