If you create a channel using a function pipe(), you can add the output end to the list poll(). Then you can write something at the inlet end of the pipe and your poll will return. Like your version of Windows.
You will need to use something asynchronous, such as threads or signal handlers, to make this work.
Another option is to use sigaction()a signal handler without a flag to install it SA_RESTART. You can use an unused type signal SIGUSR1or one of the real-time signals. If you want to abort poll(), then you send this signal, but poll()will return with -1 and errno will tune to EINTR.
, poll(), sigmask() .