This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bi-directional named pipe


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]