DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 461Bi7Kp819831 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=qGu5epbo X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB7B3381577F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1719834246; bh=Z+fUhUtv8LUxQdpZmS3kMHGTck9xrEjrpo33cQLXIHA=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=qGu5epboNEvPA6WyTx3Z52b7vVEaGRe9/ob/81YRUjT4k8/EcIGCcSlBJdaYR+1S+ ObW0uH/5KDorCIu0KOki9+xDdqVryVhH90FSV60Z5OQS1ygLpn/syAIzOe/O4vV1Xs BVULdPpMcQXw1VhnpHF5AwKitiwzcWGuh/pxGrSs= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 47986389941E ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 47986389941E ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719834213; cv=none; b=jDPj2JDpbYwMpUZMlCqunZagsA38KP6qVxIZLsTcOlET+8ejI9/vwx+oCx3TKQMKpF0z5f31TWrDMoJmY0cE7vzjwDYOnPM0qPg7oh8InoQnneFSFCYTTi2lcWOhbeIZtjFl/aA+wNz82HmcH55L7hiRJ3W4ICU3VnmEIbMVjFk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719834213; c=relaxed/simple; bh=9WKyrBfqyhTtGLAsbPCmeOeJkjTx/b2Hyw/CwhyyjYk=; h=Date:From:To:Subject:Message-Id:Mime-Version:DKIM-Signature; b=sgBfuEQLE7nXHgKEH2jNKYvHqrHP7zYZjFfeieCu6t7tKAfK0hMaMVq5v2HtcQIZCVJlW+qc+r/lHMi6Eny3HId+rrovq9F2H5CHx1cDQCsqyrWeNDXh/CWWCFMtL9zmtZZUPVWZoG1ww2kVDdhVSQP/dzfeGCB20Hv03Zg8WSQ= ARC-Authentication-Results: i=1; server2.sourceware.org Date: Mon, 1 Jul 2024 20:43:28 +0900 To: cygwin AT cygwin DOT com Subject: Re: SIGALRM is not interrupting a blocking write to a pipe Message-Id: <20240701204328.839e7bbc7b04292825b3fdc2@nifty.ne.jp> In-Reply-To: <20240701204038.1a80dd18267a2302ca838e3e@nifty.ne.jp> References: <10838112-58af-4b53-baac-39ab849662a4 AT gmail DOT com> <20240701204038 DOT 1a80dd18267a2302ca838e3e AT nifty DOT ne DOT jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Takashi Yano via Cygwin Reply-To: Takashi Yano Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" On Mon, 1 Jul 2024 20:40:38 +0900 Takashi Yano wrote: > On Mon, 6 May 2024 23:01:49 +0300 > ilya Basin wrote: > > 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. > > What Linux environment you assume? I run the STC below on Debuan GNU/Linux, > > #include > #include > #include > #include > #include > #include > > void handler(int sig) > { > printf("sig=%d\n", sig); > } > > int main() > { > int fd[2]; > > signal(SIGALRM, handler); > pipe(fd); > for (;;) { > int l = write(fd[1], "A", 1); > if (l == 1) { > printf("."); fflush(stdout); /* Normal */ > } else { > printf("%d: %s\n", l, strerror(errno)); /* Interrupt */ > } > } > } > > but, > kill -ALRM > does not make output /* Interrupt */ line, but only /* Normal */ line. and sig=14 as well. > uname -a: > Linux debian2 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 GNU/Linux > > The behaviour is same with cygwin. -- Takashi Yano -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple