public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* SIGALRM is not interrupting a blocking write to a pipe
@ 2024-05-06 20:01 ilya Basin
  0 siblings, 0 replies; only message in thread
From: ilya Basin @ 2024-05-06 20:01 UTC (permalink / raw)
  To: cygwin

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?


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-06 20:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-06 20:01 SIGALRM is not interrupting a blocking write to a pipe ilya Basin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).