Take a serial port. A serial port can call ioctl
with TIOCMIWAIT
to wait for a signal change. However if the serial port is open as non-blocking, how does one use something like select
, poll
or epoll
to break out of an event-loop when a signal line like CTS changes? Lets assume that the serial port is also used heavily for reading and writing. Spawning another thread seems like a bad option.
On Windows, OVERLAPPED
IO solves this problem perfectly.
I am interested in the specific case listed above but also how to approach writing device drivers that need to pass an interrupt to user space.