Possible fix for Midnight Commander FIFO problem under tcsh

Ken Brown kbrown@cornell.edu
Mon Dec 23 20:57:00 GMT 2019


Marco,

Corinna reported a failure of mc to open a FIFO when it is run under tcsh.  See

   https://cygwin.com/ml/cygwin/2019-12/msg00185.html

and my response.  To summarize, mc tries to open a FIFO as O_RDWR twice, and 
this fails because Cygwin's FIFO implementation currently allows only one reader 
(but multiple writers).  As a result, mc doesn't use a subshell when it is run 
under tcsh.

There is a simple fix for the problem (attached).  Unfortunately, when I apply 
this fix, mc is very slow to start up (about 10 seconds on my system) under 
tcsh.  I'm not a tcsh user, but I simply ran 'tcsh -l' and then 'mc'.  I have no 
tcsh or csh startup files in my home directory.

Running mc under strace shows that the forked tcsh subshell lists every 
directory in my PATH.  The strace output shows that the subshell calls readdir 
more than 77,000 times.  By contrast, the bash subshell doesn't call readdir at 
all when I run mc under bash.

I hope someone more familiar with tcsh can explain this and provide a 
workaround.  Otherwise, I think the fix is probably useless.

Ken
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 4.8.23-fifo.patch
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20191223/00c31c24/attachment.ksh>


More information about the Cygwin-apps mailing list