Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: FreeBSD process substitution bug

> I did a little more investigation and found the problem.  FreeBSD 5.x by 
> default only provides file descriptors 0, 1, and 2 for the current 
> process in /dev/fd.  If you want to be able to access other file 
> descriptors, you have to mount the special fdescfs filesystem on 
> /dev/fd.  The configure test to see if zsh can use /dev/fd succeeds 
> because it only tests /dev/fd/0.

Thanks for the research.  Can you see if the following gives you a
working command substitution in this case?

Index: configure.ac
RCS file: /cvsroot/zsh/zsh/configure.ac,v
retrieving revision 1.41
diff -u -r1.41 configure.ac
--- configure.ac	28 Oct 2005 17:34:33 -0000	1.41
+++ configure.ac	30 Oct 2005 16:31:06 -0000
@@ -1603,7 +1603,7 @@
 [Define to the path of the /dev/fd filesystem.])
 AC_CACHE_CHECK(for /dev/fd filesystem, zsh_cv_sys_path_dev_fd,
 [for zsh_cv_sys_path_dev_fd in /proc/self/fd /dev/fd no; do
-   test x`echo ok|cat $zsh_cv_sys_path_dev_fd/0 2>/dev/null` = xok && break
+   test x`echo ok|(exec 3<&0; cat $zsh_cv_sys_path_dev_fd/3 2>/dev/null;)` = xok && break
 if test $zsh_cv_sys_path_dev_fd != no; then
   AC_DEFINE_UNQUOTED(PATH_DEV_FD, "$zsh_cv_sys_path_dev_fd")

Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page still at http://www.pwstephenson.fsnet.co.uk/

Messages sorted by: Reverse Date, Date, Thread, Author