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]


Edited by mdavey (03/10/2004 11:45)