Solaris serial DCD interrupt

Posted by: mdavey

Solaris serial DCD interrupt - 03/10/2004 10:07

Hiya,

This is one for the Solaris SPARC programmers.

I want to call a handler routine whenever the DCD line on one of my serial ports changes status. In Linux I'd do something like this:

/* wait till a serial port status change interrupt is generated */
if (ioctl(fd, TIOCMIWAIT, TIOCM_CD)!=0) return -1;
// call handler here, which might do:
if (ioctl(fd, TIOCMGET, &arg)!=0) return -1;
return arg;

Now, clearly Solaris doesn't provide the same mechanism as Linux (TIOCMIWAIT isn't defined and neither man(1) and Google can't suggest an equivalent), so how would one do this in Solaris (other than eating CPU cycles by polling the line)?

[Edit: to clarify, I need to call some code every time there is a raising edge and every time there is a falling edge on this line]
Posted by: wfaulk

Re: Solaris serial DCD interrupt - 03/10/2004 15:40

I don't know the answer to your question, as I'm a Solaris sysadmin and not programmer, but Celeste Stokely's Solaris Serial Port Resources Guide has always been able to answer my Solaris serial port questions before.