delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/07/02/10:55:48

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Eric Blake <ebb9 AT byu DOT net>
Subject: bi-directional named pipe
Date: Thu, 2 Jul 2009 14:55:16 +0000 (UTC)
Lines: 51
Message-ID: <loom.20090702T144136-702@post.gmane.org>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
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

The upcoming upstream Autoconf 2.64 release will introduce a new feature for 
parallel testsuite execution, which can vastly decrease the time spent testing 
several packages (autoconf itself, m4, tar, findutils, ...).  However, it 
currently requires support for bi-directional named pipes.  POSIX does not 
require this, but Linux provides it; is there any chance of implementing it in 
cygwin?

On Linux:
% mkfifo fifo
% exec 5<>fifo
% echo hi >&5
% read a <&5
% exec 5<&-
% echo $a
hi
% rm fifo
%

On Cygwin:
$ mkfifo fifo
$ exec 5<>fifo
$ echo hi >&5
bash: echo: write error: Communication error on send
$ echo $?
1
$ read a <&5
$ echo $?
1
$ exec 5<&-
$ echo $a

$ rm fifo
$

In isolation, I can work around this with two fd's, but the autoconf usage is 
more involved, so I'm not sure if using two fd's instead of a single read-write 
fd will introduce other problems.

$ exec 5<fifo 6>fifo
$ echo hi >&6 &
$ read a <&5
$ wait $!
$ exec 5<&- 6>&-
$ echo $a
hi
$ rm fifo
$

-- 
Eric Blake



--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019