delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:date:from:to:subject:message-id:reply-to | |
:references:mime-version:content-type:in-reply-to; q=dns; s= | |
default; b=ERiwvpnERj9x42Zw4w5ZZKwnTFLKw52x3R7F6gzof01CE8gJC0NBL | |
GlWQOQS99r4XMM1Eo9i194PUzHKpAwZzPx9wwBb/FbweDF5pIb5xSsrL8GqN1N48 | |
CHKAH3GpgZ5H9v93OKorXPAorFH8DQzeQDdtE2evXTTovTJzJf7dwQ= | |
DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:date:from:to:subject:message-id:reply-to | |
:references:mime-version:content-type:in-reply-to; s=default; | |
bh=gb0+7Rqh6qhTqbmTsFiCjk9tDEU=; b=S1Bo/ZRDNW8cdWN1mMDSlPYCXVvR | |
oMGc/L5+I+xQ4UYZFHCDnhUnmMCc46ra6Fwi1bX0Iyh+cmvdh8QwR3mzIjOUx/SK | |
WNItUM9L0pF1ERDx+1uVBBpUnGs33Aca2LgHYAlnMqG4whZVf9ACrrx2slC7/VfY | |
VJspmoLHt/TYYe8= | |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Authentication-Results: | sourceware.org; auth=none |
X-Virus-Found: | No |
X-Spam-SWARE-Status: | No, score=-101.2 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,KHOP_DYNAMIC,RCVD_IN_BRBL_LASTEXT,RCVD_IN_PBL,RDNS_DYNAMIC,USER_IN_WHITELIST autolearn=no version=3.3.2 spammy=Maintainer, DOT, Ken, H*r:500 |
X-HELO: | calimero.vinschen.de |
Date: | Fri, 8 Jan 2016 21:50:08 +0100 |
From: | Corinna Vinschen <corinna-cygwin AT cygwin DOT com> |
To: | cygwin AT cygwin DOT com |
Subject: | Re: Problem with named pipes |
Message-ID: | <20160108205008.GM20447@calimero.vinschen.de> |
Reply-To: | cygwin AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
References: | <567DB7AB DOT 5060606 AT cornell DOT edu> |
MIME-Version: | 1.0 |
In-Reply-To: | <567DB7AB.5060606@cornell.edu> |
User-Agent: | Mutt/1.5.24 (2015-08-30) |
--yklP1rR72f9kjNtc Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Dec 25 16:39, Ken Brown wrote: > I've noticed a difference between Cygwin and Linux involving named pipes.= I > don't know if this a bug or simply a difference. >=20 > Consider the following two scripts: >=20 > $ cat fifo1.sh > #!/bin/sh > set -x > rm -f foo > mkfifo foo > exec 7>foo > echo blah > foo >=20 > $ cat fifo2.sh > #!/bin/sh > set -x > read bar < foo > echo $bar >=20 > I run fifo1.sh in Terminal 1 and get the following on both Cygwin and Lin= ux: >=20 > [Terminal 1] > $ ./fifo1.sh > + rm -f foo > + mkfifo foo > + exec >=20 > 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 "re= ad" > in fifo2.sh unblocks fifo1.sh, and I see the following: >=20 > [Terminal 1, Linux] > $ ./fifo1.sh > + rm -f foo > + mkfifo foo > + exec > + echo blah >=20 > [Terminal 2, Linux] > $ ./fifo2.sh > + read bar > + echo blah > blah >=20 > On Cygwin, however, Terminal 1 remains blocked, and Terminal 2 is blocked > when it tries to read: >=20 > [Terminal 2, Cygwin] > $ ./fifo2.sh > + read bar >=20 > 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". Very tricky problem. The FIFO code falls over its own feet trying to handle more than one writer (exec 7> is the first, echo blah is the second writer). Sigh. This code needs a thorough rewrite... Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --yklP1rR72f9kjNtc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWkCEAAAoJEPU2Bp2uRE+gD5wP+wZOwgvQnVVkSG1CIIg50WK/ xEdDvfyDbpkCDAHQuUyCX5Lu5ec7B/GwJ7NyY5ACnJIVD9U12/fKV3ZRQPYuLNGe huSp79rB4+w5CRdWROj2/5MYwQXlxFDyDLz4ue1LHdK42S31vWOk49jEnrCl4IVb 5oxdmQ+fnyR3lwohE/JEKBh2zuFen0DQJyjy70X62PpQJ9b+Q9sYPmDvRhZp7/am 3I1ALiFFhoDhZFfJPhbAHa/sjIdNC2p/x34GNh4ZLFfZ6MEbbtwleeTPPLDWcerk 5L3cQ3N4IKaGydMioV3PSuzJCfaqQ42rhRGxZWvnFziGuKzV5sAhWllPaZ9nZOY2 0qxR+uwC2MhfAYvBwHnmGCQdOF4M+pdk6ZBpQ0WPWulzzACpFxX6E0GnT68B+cBJ pVK2mQd48qGCHI2Wdn2xumzqZhEfwVUw2k39PVnisVQXdkQY46YZkaiIDPqzuISh Qj008/Y1eBBjZXPvfPfvuHjPg9Ix7b0anS4My3fMUd7WyIHjWYGMXV6zR3PUuMO5 4WJR/uUryzrAiX0wuO8GtMtnIRJP9uv1HluPZwohzZM5TIHEvnR1PMcLvpkjcstH /MuAvjC6Xuyth+LWCCsKigVRXSydkhtX6mTZBY8Rut+yfNvMyTgEuDVZ1PUSiQ0k Mc02M92A+wI6+5gRvi9J =SlzT -----END PGP SIGNATURE----- --yklP1rR72f9kjNtc--
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |