From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46566 invoked by alias); 25 Dec 2015 21:39:49 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 46554 invoked by uid 89); 25 Dec 2015 21:39:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=involving, disappears X-HELO: limerock02.mail.cornell.edu Received: from limerock02.mail.cornell.edu (HELO limerock02.mail.cornell.edu) (128.84.13.242) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 Dec 2015 21:39:48 +0000 X-CornellRouted: This message has been Routed already. Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limerock02.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id tBPLdkBN019901 for ; Fri, 25 Dec 2015 16:39:46 -0500 Received: from [192.168.1.7] (cpe-67-249-176-138.twcny.res.rr.com [67.249.176.138]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id tBPLdiJS009662 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Fri, 25 Dec 2015 16:39:45 -0500 To: cygwin From: Ken Brown Subject: Problem with named pipes Message-ID: <567DB7AB.5060606@cornell.edu> Date: Fri, 25 Dec 2015 21:39:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00311.txt.bz2 I've noticed a difference between Cygwin and Linux involving named pipes. I don't know if this a bug or simply a difference. Consider the following two scripts: $ cat fifo1.sh #!/bin/sh set -x rm -f foo mkfifo foo exec 7>foo echo blah > foo $ cat fifo2.sh #!/bin/sh set -x read bar < foo echo $bar I run fifo1.sh in Terminal 1 and get the following on both Cygwin and Linux: [Terminal 1] $ ./fifo1.sh + rm -f foo + mkfifo foo + exec The call to echo in the next line blocks, because foo has not yet been opened for reading. Now I run fifo2.sh in Terminal 2. On Linux, the "read" in fifo2.sh unblocks fifo1.sh, and I see the following: [Terminal 1, Linux] $ ./fifo1.sh + rm -f foo + mkfifo foo + exec + echo blah [Terminal 2, Linux] $ ./fifo2.sh + read bar + echo blah blah On Cygwin, however, Terminal 1 remains blocked, and Terminal 2 is blocked when it tries to read: [Terminal 2, Cygwin] $ ./fifo2.sh + read bar The problem disappears if I remove the line "exec 7>foo" from fifo1.sh. The problem also disappears if I leave that line in, but change the last line to "echo blah >&7". Ken -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple