SIGALRM is not interrupting a blocking write to a pipe

ilya Basin basinilya@gmail.com
Mon May 6 20:01:49 GMT 2024


Hi List!

I need your help with troubleshooting an issue with "pv": https://codeberg.org/a-j-wood/pv/issues/87

This app uses SIGALRM to interrupt a blocking write to STDOUT and read more data into the buffer.
On Linuxes write() returns 0 after the signal, but on Cygwin even though the signal handler is called, the write call does not return, at least when writing to a pipe.

In the user guide it says "All sockets are non-blocking under the hood to allow to interrupt blocking calls by POSIX signals". It doesn't mention pipes, but I think the pipes should also be non-blocking under the hood.

In main.c the use of O_NONBLOCK is commented with "this can cause problems with (broken) applications such as dd". If I uncomment it the app is able to detect that the pipe is ready for writing. Have you ever heard about O_NONBLOCK breaking dd?



More information about the Cygwin mailing list